imate C++/CUDA Reference
py_c_affine_matrix_function.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.24 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "NPY_NO_DEPRECATED_API",
9  "NPY_1_7_API_VERSION"
10  ]
11  ],
12  "depends": [
13  "imate/_c_linear_operator/c_affine_matrix_function.h",
14  "imate/_c_linear_operator/c_csc_affine_matrix_function.h",
15  "imate/_c_linear_operator/c_csr_affine_matrix_function.h",
16  "imate/_c_linear_operator/c_dense_affine_matrix_function.h",
17  "imate/_c_linear_operator/c_linear_operator.h"
18  ],
19  "include_dirs": [
20  "./imate/_c_linear_operator",
21  "i",
22  "m",
23  "a",
24  "t",
25  "e",
26  "/",
27  "_",
28  "c",
29  "b",
30  "s",
31  "l",
32  "g",
33  "r"
34  ],
35  "language": "c++",
36  "name": "imate._c_linear_operator.py_c_affine_matrix_function",
37  "sources": [
38  "./imate/_c_linear_operator/py_c_affine_matrix_function.pyx",
39  "./imate/_c_linear_operator/c_csc_matrix.cpp",
40  "./imate/_c_linear_operator/c_csr_matrix.cpp",
41  "./imate/_c_linear_operator/c_matrix.cpp",
42  "./imate/_c_linear_operator/c_linear_operator.cpp",
43  "./imate/_c_linear_operator/c_csr_affine_matrix_function.cpp",
44  "./imate/_c_linear_operator/c_csc_affine_matrix_function.cpp",
45  "./imate/_c_linear_operator/c_dense_affine_matrix_function.cpp",
46  "./imate/_c_linear_operator/c_dense_matrix.cpp",
47  "./imate/_c_linear_operator/c_affine_matrix_function.cpp",
48  "imate/_c_basic_algebra/cblas_interface.cpp",
49  "imate/_c_basic_algebra/c_vector_operations.cpp",
50  "imate/_c_basic_algebra/c_matrix_operations.cpp"
51  ]
52  },
53  "module_name": "imate._c_linear_operator.py_c_affine_matrix_function"
54 }
55 END: Cython Metadata */
56 
57 #ifndef PY_SSIZE_T_CLEAN
58 #define PY_SSIZE_T_CLEAN
59 #endif /* PY_SSIZE_T_CLEAN */
60 #include "Python.h"
61 #ifndef Py_PYTHON_H
62  #error Python headers needed to compile C extensions, please install development version of Python.
63 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
64  #error Cython requires Python 2.6+ or Python 3.3+.
65 #else
66 #define CYTHON_ABI "0_29_24"
67 #define CYTHON_HEX_VERSION 0x001D18F0
68 #define CYTHON_FUTURE_DIVISION 1
69 #include <stddef.h>
70 #ifndef offsetof
71  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
72 #endif
73 #if !defined(WIN32) && !defined(MS_WINDOWS)
74  #ifndef __stdcall
75  #define __stdcall
76  #endif
77  #ifndef __cdecl
78  #define __cdecl
79  #endif
80  #ifndef __fastcall
81  #define __fastcall
82  #endif
83 #endif
84 #ifndef DL_IMPORT
85  #define DL_IMPORT(t) t
86 #endif
87 #ifndef DL_EXPORT
88  #define DL_EXPORT(t) t
89 #endif
90 #define __PYX_COMMA ,
91 #ifndef HAVE_LONG_LONG
92  #if PY_VERSION_HEX >= 0x02070000
93  #define HAVE_LONG_LONG
94  #endif
95 #endif
96 #ifndef PY_LONG_LONG
97  #define PY_LONG_LONG LONG_LONG
98 #endif
99 #ifndef Py_HUGE_VAL
100  #define Py_HUGE_VAL HUGE_VAL
101 #endif
102 #ifdef PYPY_VERSION
103  #define CYTHON_COMPILING_IN_PYPY 1
104  #define CYTHON_COMPILING_IN_PYSTON 0
105  #define CYTHON_COMPILING_IN_CPYTHON 0
106  #undef CYTHON_USE_TYPE_SLOTS
107  #define CYTHON_USE_TYPE_SLOTS 0
108  #undef CYTHON_USE_PYTYPE_LOOKUP
109  #define CYTHON_USE_PYTYPE_LOOKUP 0
110  #if PY_VERSION_HEX < 0x03050000
111  #undef CYTHON_USE_ASYNC_SLOTS
112  #define CYTHON_USE_ASYNC_SLOTS 0
113  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
114  #define CYTHON_USE_ASYNC_SLOTS 1
115  #endif
116  #undef CYTHON_USE_PYLIST_INTERNALS
117  #define CYTHON_USE_PYLIST_INTERNALS 0
118  #undef CYTHON_USE_UNICODE_INTERNALS
119  #define CYTHON_USE_UNICODE_INTERNALS 0
120  #undef CYTHON_USE_UNICODE_WRITER
121  #define CYTHON_USE_UNICODE_WRITER 0
122  #undef CYTHON_USE_PYLONG_INTERNALS
123  #define CYTHON_USE_PYLONG_INTERNALS 0
124  #undef CYTHON_AVOID_BORROWED_REFS
125  #define CYTHON_AVOID_BORROWED_REFS 1
126  #undef CYTHON_ASSUME_SAFE_MACROS
127  #define CYTHON_ASSUME_SAFE_MACROS 0
128  #undef CYTHON_UNPACK_METHODS
129  #define CYTHON_UNPACK_METHODS 0
130  #undef CYTHON_FAST_THREAD_STATE
131  #define CYTHON_FAST_THREAD_STATE 0
132  #undef CYTHON_FAST_PYCALL
133  #define CYTHON_FAST_PYCALL 0
134  #undef CYTHON_PEP489_MULTI_PHASE_INIT
135  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
136  #undef CYTHON_USE_TP_FINALIZE
137  #define CYTHON_USE_TP_FINALIZE 0
138  #undef CYTHON_USE_DICT_VERSIONS
139  #define CYTHON_USE_DICT_VERSIONS 0
140  #undef CYTHON_USE_EXC_INFO_STACK
141  #define CYTHON_USE_EXC_INFO_STACK 0
142 #elif defined(PYSTON_VERSION)
143  #define CYTHON_COMPILING_IN_PYPY 0
144  #define CYTHON_COMPILING_IN_PYSTON 1
145  #define CYTHON_COMPILING_IN_CPYTHON 0
146  #ifndef CYTHON_USE_TYPE_SLOTS
147  #define CYTHON_USE_TYPE_SLOTS 1
148  #endif
149  #undef CYTHON_USE_PYTYPE_LOOKUP
150  #define CYTHON_USE_PYTYPE_LOOKUP 0
151  #undef CYTHON_USE_ASYNC_SLOTS
152  #define CYTHON_USE_ASYNC_SLOTS 0
153  #undef CYTHON_USE_PYLIST_INTERNALS
154  #define CYTHON_USE_PYLIST_INTERNALS 0
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #undef CYTHON_USE_UNICODE_WRITER
159  #define CYTHON_USE_UNICODE_WRITER 0
160  #undef CYTHON_USE_PYLONG_INTERNALS
161  #define CYTHON_USE_PYLONG_INTERNALS 0
162  #ifndef CYTHON_AVOID_BORROWED_REFS
163  #define CYTHON_AVOID_BORROWED_REFS 0
164  #endif
165  #ifndef CYTHON_ASSUME_SAFE_MACROS
166  #define CYTHON_ASSUME_SAFE_MACROS 1
167  #endif
168  #ifndef CYTHON_UNPACK_METHODS
169  #define CYTHON_UNPACK_METHODS 1
170  #endif
171  #undef CYTHON_FAST_THREAD_STATE
172  #define CYTHON_FAST_THREAD_STATE 0
173  #undef CYTHON_FAST_PYCALL
174  #define CYTHON_FAST_PYCALL 0
175  #undef CYTHON_PEP489_MULTI_PHASE_INIT
176  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
177  #undef CYTHON_USE_TP_FINALIZE
178  #define CYTHON_USE_TP_FINALIZE 0
179  #undef CYTHON_USE_DICT_VERSIONS
180  #define CYTHON_USE_DICT_VERSIONS 0
181  #undef CYTHON_USE_EXC_INFO_STACK
182  #define CYTHON_USE_EXC_INFO_STACK 0
183 #else
184  #define CYTHON_COMPILING_IN_PYPY 0
185  #define CYTHON_COMPILING_IN_PYSTON 0
186  #define CYTHON_COMPILING_IN_CPYTHON 1
187  #ifndef CYTHON_USE_TYPE_SLOTS
188  #define CYTHON_USE_TYPE_SLOTS 1
189  #endif
190  #if PY_VERSION_HEX < 0x02070000
191  #undef CYTHON_USE_PYTYPE_LOOKUP
192  #define CYTHON_USE_PYTYPE_LOOKUP 0
193  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
194  #define CYTHON_USE_PYTYPE_LOOKUP 1
195  #endif
196  #if PY_MAJOR_VERSION < 3
197  #undef CYTHON_USE_ASYNC_SLOTS
198  #define CYTHON_USE_ASYNC_SLOTS 0
199  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
200  #define CYTHON_USE_ASYNC_SLOTS 1
201  #endif
202  #if PY_VERSION_HEX < 0x02070000
203  #undef CYTHON_USE_PYLONG_INTERNALS
204  #define CYTHON_USE_PYLONG_INTERNALS 0
205  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
206  #define CYTHON_USE_PYLONG_INTERNALS 1
207  #endif
208  #ifndef CYTHON_USE_PYLIST_INTERNALS
209  #define CYTHON_USE_PYLIST_INTERNALS 1
210  #endif
211  #ifndef CYTHON_USE_UNICODE_INTERNALS
212  #define CYTHON_USE_UNICODE_INTERNALS 1
213  #endif
214  #if PY_VERSION_HEX < 0x030300F0
215  #undef CYTHON_USE_UNICODE_WRITER
216  #define CYTHON_USE_UNICODE_WRITER 0
217  #elif !defined(CYTHON_USE_UNICODE_WRITER)
218  #define CYTHON_USE_UNICODE_WRITER 1
219  #endif
220  #ifndef CYTHON_AVOID_BORROWED_REFS
221  #define CYTHON_AVOID_BORROWED_REFS 0
222  #endif
223  #ifndef CYTHON_ASSUME_SAFE_MACROS
224  #define CYTHON_ASSUME_SAFE_MACROS 1
225  #endif
226  #ifndef CYTHON_UNPACK_METHODS
227  #define CYTHON_UNPACK_METHODS 1
228  #endif
229  #ifndef CYTHON_FAST_THREAD_STATE
230  #define CYTHON_FAST_THREAD_STATE 1
231  #endif
232  #ifndef CYTHON_FAST_PYCALL
233  #define CYTHON_FAST_PYCALL 1
234  #endif
235  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
236  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
237  #endif
238  #ifndef CYTHON_USE_TP_FINALIZE
239  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
240  #endif
241  #ifndef CYTHON_USE_DICT_VERSIONS
242  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
243  #endif
244  #ifndef CYTHON_USE_EXC_INFO_STACK
245  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
246  #endif
247 #endif
248 #if !defined(CYTHON_FAST_PYCCALL)
249 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
250 #endif
251 #if CYTHON_USE_PYLONG_INTERNALS
252  #include "longintrepr.h"
253  #undef SHIFT
254  #undef BASE
255  #undef MASK
256  #ifdef SIZEOF_VOID_P
257  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
258  #endif
259 #endif
260 #ifndef __has_attribute
261  #define __has_attribute(x) 0
262 #endif
263 #ifndef __has_cpp_attribute
264  #define __has_cpp_attribute(x) 0
265 #endif
266 #ifndef CYTHON_RESTRICT
267  #if defined(__GNUC__)
268  #define CYTHON_RESTRICT __restrict__
269  #elif defined(_MSC_VER) && _MSC_VER >= 1400
270  #define CYTHON_RESTRICT __restrict
271  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
272  #define CYTHON_RESTRICT restrict
273  #else
274  #define CYTHON_RESTRICT
275  #endif
276 #endif
277 #ifndef CYTHON_UNUSED
278 # if defined(__GNUC__)
279 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
280 # define CYTHON_UNUSED __attribute__ ((__unused__))
281 # else
282 # define CYTHON_UNUSED
283 # endif
284 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
285 # define CYTHON_UNUSED __attribute__ ((__unused__))
286 # else
287 # define CYTHON_UNUSED
288 # endif
289 #endif
290 #ifndef CYTHON_MAYBE_UNUSED_VAR
291 # if defined(__cplusplus)
292  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
293 # else
294 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
295 # endif
296 #endif
297 #ifndef CYTHON_NCP_UNUSED
298 # if CYTHON_COMPILING_IN_CPYTHON
299 # define CYTHON_NCP_UNUSED
300 # else
301 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
302 # endif
303 #endif
304 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
305 #ifdef _MSC_VER
306  #ifndef _MSC_STDINT_H_
307  #if _MSC_VER < 1300
308  typedef unsigned char uint8_t;
309  typedef unsigned int uint32_t;
310  #else
311  typedef unsigned __int8 uint8_t;
312  typedef unsigned __int32 uint32_t;
313  #endif
314  #endif
315 #else
316  #include <stdint.h>
317 #endif
318 #ifndef CYTHON_FALLTHROUGH
319  #if defined(__cplusplus) && __cplusplus >= 201103L
320  #if __has_cpp_attribute(fallthrough)
321  #define CYTHON_FALLTHROUGH [[fallthrough]]
322  #elif __has_cpp_attribute(clang::fallthrough)
323  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
324  #elif __has_cpp_attribute(gnu::fallthrough)
325  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
326  #endif
327  #endif
328  #ifndef CYTHON_FALLTHROUGH
329  #if __has_attribute(fallthrough)
330  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
331  #else
332  #define CYTHON_FALLTHROUGH
333  #endif
334  #endif
335  #if defined(__clang__ ) && defined(__apple_build_version__)
336  #if __apple_build_version__ < 7000000
337  #undef CYTHON_FALLTHROUGH
338  #define CYTHON_FALLTHROUGH
339  #endif
340  #endif
341 #endif
342 
343 #ifndef __cplusplus
344  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
345 #endif
346 #ifndef CYTHON_INLINE
347  #if defined(__clang__)
348  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
349  #else
350  #define CYTHON_INLINE inline
351  #endif
352 #endif
353 template<typename T>
354 void __Pyx_call_destructor(T& x) {
355  x.~T();
356 }
357 template<typename T>
358 class __Pyx_FakeReference {
359  public:
360  __Pyx_FakeReference() : ptr(NULL) { }
361  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
362  T *operator->() { return ptr; }
363  T *operator&() { return ptr; }
364  operator T&() { return *ptr; }
365  template<typename U> bool operator ==(U other) { return *ptr == other; }
366  template<typename U> bool operator !=(U other) { return *ptr != other; }
367  private:
368  T *ptr;
369 };
370 
371 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
372  #define Py_OptimizeFlag 0
373 #endif
374 #define __PYX_BUILD_PY_SSIZE_T "n"
375 #define CYTHON_FORMAT_SSIZE_T "z"
376 #if PY_MAJOR_VERSION < 3
377  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
378  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
379  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
380  #define __Pyx_DefaultClassType PyClass_Type
381 #else
382  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
383 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
384  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
385  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
386 #else
387  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
388  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
389 #endif
390  #define __Pyx_DefaultClassType PyType_Type
391 #endif
392 #ifndef Py_TPFLAGS_CHECKTYPES
393  #define Py_TPFLAGS_CHECKTYPES 0
394 #endif
395 #ifndef Py_TPFLAGS_HAVE_INDEX
396  #define Py_TPFLAGS_HAVE_INDEX 0
397 #endif
398 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
399  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
400 #endif
401 #ifndef Py_TPFLAGS_HAVE_FINALIZE
402  #define Py_TPFLAGS_HAVE_FINALIZE 0
403 #endif
404 #ifndef METH_STACKLESS
405  #define METH_STACKLESS 0
406 #endif
407 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
408  #ifndef METH_FASTCALL
409  #define METH_FASTCALL 0x80
410  #endif
411  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
412  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
413  Py_ssize_t nargs, PyObject *kwnames);
414 #else
415  #define __Pyx_PyCFunctionFast _PyCFunctionFast
416  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
417 #endif
418 #if CYTHON_FAST_PYCCALL
419 #define __Pyx_PyFastCFunction_Check(func)\
420  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
421 #else
422 #define __Pyx_PyFastCFunction_Check(func) 0
423 #endif
424 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
425  #define PyObject_Malloc(s) PyMem_Malloc(s)
426  #define PyObject_Free(p) PyMem_Free(p)
427  #define PyObject_Realloc(p) PyMem_Realloc(p)
428 #endif
429 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
430  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
431  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
432  #define PyMem_RawFree(p) PyMem_Free(p)
433 #endif
434 #if CYTHON_COMPILING_IN_PYSTON
435  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
436  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
437 #else
438  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
439  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
440 #endif
441 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
442  #define __Pyx_PyThreadState_Current PyThreadState_GET()
443 #elif PY_VERSION_HEX >= 0x03060000
444  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
445 #elif PY_VERSION_HEX >= 0x03000000
446  #define __Pyx_PyThreadState_Current PyThreadState_GET()
447 #else
448  #define __Pyx_PyThreadState_Current _PyThreadState_Current
449 #endif
450 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
451 #include "pythread.h"
452 #define Py_tss_NEEDS_INIT 0
453 typedef int Py_tss_t;
454 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
455  *key = PyThread_create_key();
456  return 0;
457 }
458 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
459  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
460  *key = Py_tss_NEEDS_INIT;
461  return key;
462 }
463 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
464  PyObject_Free(key);
465 }
466 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
467  return *key != Py_tss_NEEDS_INIT;
468 }
469 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
470  PyThread_delete_key(*key);
471  *key = Py_tss_NEEDS_INIT;
472 }
473 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
474  return PyThread_set_key_value(*key, value);
475 }
476 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
477  return PyThread_get_key_value(*key);
478 }
479 #endif
480 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
481 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
482 #else
483 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
484 #endif
485 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
486  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
487  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
488 #else
489  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
490  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
491 #endif
492 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
493 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
494 #else
495 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
496 #endif
497 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
498  #define CYTHON_PEP393_ENABLED 1
499  #if defined(PyUnicode_IS_READY)
500  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
501  0 : _PyUnicode_Ready((PyObject *)(op)))
502  #else
503  #define __Pyx_PyUnicode_READY(op) (0)
504  #endif
505  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
506  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
507  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
508  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
509  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
510  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
511  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
512  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
513  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
514  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
515  #else
516  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
517  #endif
518  #else
519  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
520  #endif
521 #else
522  #define CYTHON_PEP393_ENABLED 0
523  #define PyUnicode_1BYTE_KIND 1
524  #define PyUnicode_2BYTE_KIND 2
525  #define PyUnicode_4BYTE_KIND 4
526  #define __Pyx_PyUnicode_READY(op) (0)
527  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
528  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
529  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
530  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
531  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
532  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
533  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
534  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
535 #endif
536 #if CYTHON_COMPILING_IN_PYPY
537  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
538  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
539 #else
540  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
541  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
542  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
543 #endif
544 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
545  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
546 #endif
547 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
548  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
549 #endif
550 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
551  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
552 #endif
553 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
554 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
555 #if PY_MAJOR_VERSION >= 3
556  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
557 #else
558  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
559 #endif
560 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
561  #define PyObject_ASCII(o) PyObject_Repr(o)
562 #endif
563 #if PY_MAJOR_VERSION >= 3
564  #define PyBaseString_Type PyUnicode_Type
565  #define PyStringObject PyUnicodeObject
566  #define PyString_Type PyUnicode_Type
567  #define PyString_Check PyUnicode_Check
568  #define PyString_CheckExact PyUnicode_CheckExact
569 #ifndef PyObject_Unicode
570  #define PyObject_Unicode PyObject_Str
571 #endif
572 #endif
573 #if PY_MAJOR_VERSION >= 3
574  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
575  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
576 #else
577  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
578  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
579 #endif
580 #ifndef PySet_CheckExact
581  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
582 #endif
583 #if PY_VERSION_HEX >= 0x030900A4
584  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
585  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
586 #else
587  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
588  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
589 #endif
590 #if CYTHON_ASSUME_SAFE_MACROS
591  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
592 #else
593  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
594 #endif
595 #if PY_MAJOR_VERSION >= 3
596  #define PyIntObject PyLongObject
597  #define PyInt_Type PyLong_Type
598  #define PyInt_Check(op) PyLong_Check(op)
599  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
600  #define PyInt_FromString PyLong_FromString
601  #define PyInt_FromUnicode PyLong_FromUnicode
602  #define PyInt_FromLong PyLong_FromLong
603  #define PyInt_FromSize_t PyLong_FromSize_t
604  #define PyInt_FromSsize_t PyLong_FromSsize_t
605  #define PyInt_AsLong PyLong_AsLong
606  #define PyInt_AS_LONG PyLong_AS_LONG
607  #define PyInt_AsSsize_t PyLong_AsSsize_t
608  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
609  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
610  #define PyNumber_Int PyNumber_Long
611 #endif
612 #if PY_MAJOR_VERSION >= 3
613  #define PyBoolObject PyLongObject
614 #endif
615 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
616  #ifndef PyUnicode_InternFromString
617  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
618  #endif
619 #endif
620 #if PY_VERSION_HEX < 0x030200A4
621  typedef long Py_hash_t;
622  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
623  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
624 #else
625  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
626  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
627 #endif
628 #if PY_MAJOR_VERSION >= 3
629  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
630 #else
631  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
632 #endif
633 #if CYTHON_USE_ASYNC_SLOTS
634  #if PY_VERSION_HEX >= 0x030500B1
635  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
636  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
637  #else
638  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
639  #endif
640 #else
641  #define __Pyx_PyType_AsAsync(obj) NULL
642 #endif
643 #ifndef __Pyx_PyAsyncMethodsStruct
644  typedef struct {
645  unaryfunc am_await;
646  unaryfunc am_aiter;
647  unaryfunc am_anext;
648  } __Pyx_PyAsyncMethodsStruct;
649 #endif
650 
651 #if defined(WIN32) || defined(MS_WINDOWS)
652  #define _USE_MATH_DEFINES
653 #endif
654 #include <math.h>
655 #ifdef NAN
656 #define __PYX_NAN() ((float) NAN)
657 #else
658 static CYTHON_INLINE float __PYX_NAN() {
659  float value;
660  memset(&value, 0xFF, sizeof(value));
661  return value;
662 }
663 #endif
664 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
665 #define __Pyx_truncl trunc
666 #else
667 #define __Pyx_truncl truncl
668 #endif
669 
670 #define __PYX_MARK_ERR_POS(f_index, lineno) \
671  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
672 #define __PYX_ERR(f_index, lineno, Ln_error) \
673  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
674 
675 #ifndef __PYX_EXTERN_C
676  #ifdef __cplusplus
677  #define __PYX_EXTERN_C extern "C"
678  #else
679  #define __PYX_EXTERN_C extern
680  #endif
681 #endif
682 
683 #define __PYX_HAVE__imate___c_linear_operator__py_c_affine_matrix_function
684 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_affine_matrix_function
685 /* Early includes */
686 #include "ios"
687 #include "new"
688 #include "stdexcept"
689 #include "typeinfo"
690 #include "c_linear_operator.h"
695 #include "pythread.h"
696 #include <string.h>
697 #include <stdlib.h>
698 #include <stdio.h>
699 #include "pystate.h"
700 #ifdef _OPENMP
701 #include <omp.h>
702 #endif /* _OPENMP */
703 
704 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
705 #define CYTHON_WITHOUT_ASSERTIONS
706 #endif
707 
708 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
709  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
710 
711 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
712 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
713 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
714 #define __PYX_DEFAULT_STRING_ENCODING ""
715 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
716 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
717 #define __Pyx_uchar_cast(c) ((unsigned char)c)
718 #define __Pyx_long_cast(x) ((long)x)
719 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
720  (sizeof(type) < sizeof(Py_ssize_t)) ||\
721  (sizeof(type) > sizeof(Py_ssize_t) &&\
722  likely(v < (type)PY_SSIZE_T_MAX ||\
723  v == (type)PY_SSIZE_T_MAX) &&\
724  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
725  v == (type)PY_SSIZE_T_MIN))) ||\
726  (sizeof(type) == sizeof(Py_ssize_t) &&\
727  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
728  v == (type)PY_SSIZE_T_MAX))) )
729 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
730  return (size_t) i < (size_t) limit;
731 }
732 #if defined (__cplusplus) && __cplusplus >= 201103L
733  #include <cstdlib>
734  #define __Pyx_sst_abs(value) std::abs(value)
735 #elif SIZEOF_INT >= SIZEOF_SIZE_T
736  #define __Pyx_sst_abs(value) abs(value)
737 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
738  #define __Pyx_sst_abs(value) labs(value)
739 #elif defined (_MSC_VER)
740  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
741 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
742  #define __Pyx_sst_abs(value) llabs(value)
743 #elif defined (__GNUC__)
744  #define __Pyx_sst_abs(value) __builtin_llabs(value)
745 #else
746  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
747 #endif
748 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
749 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
750 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
751 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
752 #define __Pyx_PyBytes_FromString PyBytes_FromString
753 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
754 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
755 #if PY_MAJOR_VERSION < 3
756  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
757  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
758 #else
759  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
760  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
761 #endif
762 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
763 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
764 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
765 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
766 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
767 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
768 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
769 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
770 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
771 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
772 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
773 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
774 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
775 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
776 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
777 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
778 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
779  const Py_UNICODE *u_end = u;
780  while (*u_end++) ;
781  return (size_t)(u_end - u - 1);
782 }
783 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
784 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
785 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
786 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
787 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
788 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
789 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
790 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
791 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
792 #define __Pyx_PySequence_Tuple(obj)\
793  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
794 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
795 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
796 #if CYTHON_ASSUME_SAFE_MACROS
797 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
798 #else
799 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
800 #endif
801 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
802 #if PY_MAJOR_VERSION >= 3
803 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
804 #else
805 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
806 #endif
807 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
808 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
809 static int __Pyx_sys_getdefaultencoding_not_ascii;
810 static int __Pyx_init_sys_getdefaultencoding_params(void) {
811  PyObject* sys;
812  PyObject* default_encoding = NULL;
813  PyObject* ascii_chars_u = NULL;
814  PyObject* ascii_chars_b = NULL;
815  const char* default_encoding_c;
816  sys = PyImport_ImportModule("sys");
817  if (!sys) goto bad;
818  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
819  Py_DECREF(sys);
820  if (!default_encoding) goto bad;
821  default_encoding_c = PyBytes_AsString(default_encoding);
822  if (!default_encoding_c) goto bad;
823  if (strcmp(default_encoding_c, "ascii") == 0) {
824  __Pyx_sys_getdefaultencoding_not_ascii = 0;
825  } else {
826  char ascii_chars[128];
827  int c;
828  for (c = 0; c < 128; c++) {
829  ascii_chars[c] = c;
830  }
831  __Pyx_sys_getdefaultencoding_not_ascii = 1;
832  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
833  if (!ascii_chars_u) goto bad;
834  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
835  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
836  PyErr_Format(
837  PyExc_ValueError,
838  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
839  default_encoding_c);
840  goto bad;
841  }
842  Py_DECREF(ascii_chars_u);
843  Py_DECREF(ascii_chars_b);
844  }
845  Py_DECREF(default_encoding);
846  return 0;
847 bad:
848  Py_XDECREF(default_encoding);
849  Py_XDECREF(ascii_chars_u);
850  Py_XDECREF(ascii_chars_b);
851  return -1;
852 }
853 #endif
854 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
855 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
856 #else
857 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
858 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
859 static char* __PYX_DEFAULT_STRING_ENCODING;
860 static int __Pyx_init_sys_getdefaultencoding_params(void) {
861  PyObject* sys;
862  PyObject* default_encoding = NULL;
863  char* default_encoding_c;
864  sys = PyImport_ImportModule("sys");
865  if (!sys) goto bad;
866  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
867  Py_DECREF(sys);
868  if (!default_encoding) goto bad;
869  default_encoding_c = PyBytes_AsString(default_encoding);
870  if (!default_encoding_c) goto bad;
871  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
872  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
873  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
874  Py_DECREF(default_encoding);
875  return 0;
876 bad:
877  Py_XDECREF(default_encoding);
878  return -1;
879 }
880 #endif
881 #endif
882 
883 
884 /* Test for GCC > 2.95 */
885 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
886  #define likely(x) __builtin_expect(!!(x), 1)
887  #define unlikely(x) __builtin_expect(!!(x), 0)
888 #else /* !__GNUC__ or GCC < 2.95 */
889  #define likely(x) (x)
890  #define unlikely(x) (x)
891 #endif /* __GNUC__ */
892 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
893 
894 static PyObject *__pyx_m = NULL;
895 static PyObject *__pyx_d;
896 static PyObject *__pyx_b;
897 static PyObject *__pyx_cython_runtime = NULL;
898 static PyObject *__pyx_empty_tuple;
899 static PyObject *__pyx_empty_bytes;
900 static PyObject *__pyx_empty_unicode;
901 static int __pyx_lineno;
902 static int __pyx_clineno = 0;
903 static const char * __pyx_cfilenm= __FILE__;
904 static const char *__pyx_filename;
905 
906 
907 static const char *__pyx_f[] = {
908  "imate/_c_linear_operator/py_c_affine_matrix_function.pyx",
909  "stringsource",
910 };
911 /* MemviewSliceStruct.proto */
912 struct __pyx_memoryview_obj;
913 typedef struct {
914  struct __pyx_memoryview_obj *memview;
915  char *data;
916  Py_ssize_t shape[8];
917  Py_ssize_t strides[8];
918  Py_ssize_t suboffsets[8];
919 } __Pyx_memviewslice;
920 #define __Pyx_MemoryView_Len(m) (m.shape[0])
921 
922 /* Atomics.proto */
923 #include <pythread.h>
924 #ifndef CYTHON_ATOMICS
925  #define CYTHON_ATOMICS 1
926 #endif
927 #define __pyx_atomic_int_type int
928 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
929  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
930  !defined(__i386__)
931  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
932  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
933  #ifdef __PYX_DEBUG_ATOMICS
934  #warning "Using GNU atomics"
935  #endif
936 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
937  #include <Windows.h>
938  #undef __pyx_atomic_int_type
939  #define __pyx_atomic_int_type LONG
940  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
941  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
942  #ifdef __PYX_DEBUG_ATOMICS
943  #pragma message ("Using MSVC atomics")
944  #endif
945 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
946  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
947  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
948  #ifdef __PYX_DEBUG_ATOMICS
949  #warning "Using Intel atomics"
950  #endif
951 #else
952  #undef CYTHON_ATOMICS
953  #define CYTHON_ATOMICS 0
954  #ifdef __PYX_DEBUG_ATOMICS
955  #warning "Not using atomics"
956  #endif
957 #endif
958 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
959 #if CYTHON_ATOMICS
960  #define __pyx_add_acquisition_count(memview)\
961  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
962  #define __pyx_sub_acquisition_count(memview)\
963  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
964 #else
965  #define __pyx_add_acquisition_count(memview)\
966  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
967  #define __pyx_sub_acquisition_count(memview)\
968  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
969 #endif
970 
971 /* ForceInitThreads.proto */
972 #ifndef __PYX_FORCE_INIT_THREADS
973  #define __PYX_FORCE_INIT_THREADS 0
974 #endif
975 
976 /* NoFastGil.proto */
977 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
978 #define __Pyx_PyGILState_Release PyGILState_Release
979 #define __Pyx_FastGIL_Remember()
980 #define __Pyx_FastGIL_Forget()
981 #define __Pyx_FastGilFuncInit()
982 
983 /* BufferFormatStructs.proto */
984 #define IS_UNSIGNED(type) (((type) -1) > 0)
985 struct __Pyx_StructField_;
986 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
987 typedef struct {
988  const char* name;
989  struct __Pyx_StructField_* fields;
990  size_t size;
991  size_t arraysize[8];
992  int ndim;
993  char typegroup;
994  char is_unsigned;
995  int flags;
996 } __Pyx_TypeInfo;
997 typedef struct __Pyx_StructField_ {
998  __Pyx_TypeInfo* type;
999  const char* name;
1000  size_t offset;
1001 } __Pyx_StructField;
1002 typedef struct {
1003  __Pyx_StructField* field;
1004  size_t parent_offset;
1005 } __Pyx_BufFmt_StackElem;
1006 typedef struct {
1007  __Pyx_StructField root;
1008  __Pyx_BufFmt_StackElem* head;
1009  size_t fmt_offset;
1010  size_t new_count, enc_count;
1011  size_t struct_alignment;
1012  int is_complex;
1013  char enc_type;
1014  char new_packmode;
1015  char enc_packmode;
1016  char is_valid_array;
1017 } __Pyx_BufFmt_Context;
1018 
1019 
1020 /* "_definitions/types.pxd":97
1021  * ctypedef unsigned int[:] MemoryViewLongIndexType
1022  * ELSE:
1023  * ctypedef int LongIndexType # <<<<<<<<<<<<<<
1024  * ctypedef const int ConstLongIndexType
1025  * ctypedef int[:] MemoryViewLongIndexType
1026  */
1027 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1028 
1029 /* "_definitions/types.pxd":98
1030  * ELSE:
1031  * ctypedef int LongIndexType
1032  * ctypedef const int ConstLongIndexType # <<<<<<<<<<<<<<
1033  * ctypedef int[:] MemoryViewLongIndexType
1034  *
1035  */
1036 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1037 
1038 /* "_definitions/types.pxd":102
1039  *
1040  * # Used for indices of small matrices, or small size iterators
1041  * ctypedef int IndexType # <<<<<<<<<<<<<<
1042  * ctypedef const int ConstIndexType
1043  * ctypedef int[:] MemoryViewIndexType
1044  */
1045 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1046 
1047 /* "_definitions/types.pxd":103
1048  * # Used for indices of small matrices, or small size iterators
1049  * ctypedef int IndexType
1050  * ctypedef const int ConstIndexType # <<<<<<<<<<<<<<
1051  * ctypedef int[:] MemoryViewIndexType
1052  *
1053  */
1054 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1055 
1056 /* "_definitions/types.pxd":107
1057  *
1058  * # Used for both flags and integers used as signals, including negative integers
1059  * ctypedef int FlagType # <<<<<<<<<<<<<<
1060  * ctypedef const int ConstFlagType
1061  * ctypedef int[:] MemoryViewFlagType
1062  */
1063 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1064 
1065 /* "_definitions/types.pxd":108
1066  * # Used for both flags and integers used as signals, including negative integers
1067  * ctypedef int FlagType
1068  * ctypedef const int ConstFlagType # <<<<<<<<<<<<<<
1069  * ctypedef int[:] MemoryViewFlagType
1070  *
1071  */
1072 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1073 
1074 /*--- Type declarations ---*/
1075 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1076 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1077 struct __pyx_array_obj;
1078 struct __pyx_MemviewEnum_obj;
1079 struct __pyx_memoryview_obj;
1080 struct __pyx_memoryviewslice_obj;
1081 
1082 /* "_definitions/types.pxd":99
1083  * ctypedef int LongIndexType
1084  * ctypedef const int ConstLongIndexType
1085  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1086  *
1087  * # Used for indices of small matrices, or small size iterators
1088  */
1089 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1090 
1091 /* "_definitions/types.pxd":104
1092  * ctypedef int IndexType
1093  * ctypedef const int ConstIndexType
1094  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1095  *
1096  * # Used for both flags and integers used as signals, including negative integers
1097  */
1098 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1099 
1100 /* "_definitions/types.pxd":109
1101  * ctypedef int FlagType
1102  * ctypedef const int ConstFlagType
1103  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1104  *
1105  *
1106  */
1107 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1108 
1109 /* "_definitions/types.pxd":116
1110  * # ==============
1111  *
1112  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1113  * const double x,
1114  * const double kernel_param) nogil
1115  */
1116 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1117 
1118 /* "py_c_linear_operator.pxd":23
1119  * # ===================
1120  *
1121  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1122  *
1123  * # Attributes
1124  */
1125 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1126  PyObject_HEAD
1127  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1128  cLinearOperator<float> *Aop_float;
1129  cLinearOperator<double> *Aop_double;
1130  cLinearOperator<long double> *Aop_long_double;
1131  char *data_type_name;
1132  char *long_index_type_name;
1133  __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1134  PyObject *parameters;
1135 };
1136 
1137 
1138 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pxd":21
1139  * # ==========================
1140  *
1141  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1142  * cdef A_csr
1143  * cdef B_csr
1144  */
1145 struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1146  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1147  PyObject *A_csr;
1148  PyObject *B_csr;
1149  PyObject *A_indices_copy;
1150  PyObject *A_index_pointer_copy;
1151  PyObject *B_indices_copy;
1152  PyObject *B_index_pointer_copy;
1153 };
1154 
1155 
1156 /* "View.MemoryView":105
1157  *
1158  * @cname("__pyx_array")
1159  * cdef class array: # <<<<<<<<<<<<<<
1160  *
1161  * cdef:
1162  */
1163 struct __pyx_array_obj {
1164  PyObject_HEAD
1165  struct __pyx_vtabstruct_array *__pyx_vtab;
1166  char *data;
1167  Py_ssize_t len;
1168  char *format;
1169  int ndim;
1170  Py_ssize_t *_shape;
1171  Py_ssize_t *_strides;
1172  Py_ssize_t itemsize;
1173  PyObject *mode;
1174  PyObject *_format;
1175  void (*callback_free_data)(void *);
1176  int free_data;
1177  int dtype_is_object;
1178 };
1179 
1180 
1181 /* "View.MemoryView":279
1182  *
1183  * @cname('__pyx_MemviewEnum')
1184  * cdef class Enum(object): # <<<<<<<<<<<<<<
1185  * cdef object name
1186  * def __init__(self, name):
1187  */
1188 struct __pyx_MemviewEnum_obj {
1189  PyObject_HEAD
1190  PyObject *name;
1191 };
1192 
1193 
1194 /* "View.MemoryView":330
1195  *
1196  * @cname('__pyx_memoryview')
1197  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1198  *
1199  * cdef object obj
1200  */
1201 struct __pyx_memoryview_obj {
1202  PyObject_HEAD
1203  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1204  PyObject *obj;
1205  PyObject *_size;
1206  PyObject *_array_interface;
1207  PyThread_type_lock lock;
1208  __pyx_atomic_int acquisition_count[2];
1209  __pyx_atomic_int *acquisition_count_aligned_p;
1210  Py_buffer view;
1211  int flags;
1212  int dtype_is_object;
1213  __Pyx_TypeInfo *typeinfo;
1214 };
1215 
1216 
1217 /* "View.MemoryView":965
1218  *
1219  * @cname('__pyx_memoryviewslice')
1220  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1221  * "Internal class for passing memoryview slices to Python"
1222  *
1223  */
1224 struct __pyx_memoryviewslice_obj {
1225  struct __pyx_memoryview_obj __pyx_base;
1226  __Pyx_memviewslice from_slice;
1227  PyObject *from_object;
1228  PyObject *(*to_object_func)(char *);
1229  int (*to_dtype_func)(char *, PyObject *);
1230 };
1231 
1232 
1233 
1234 /* "py_c_linear_operator.pxd":23
1235  * # ===================
1236  *
1237  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1238  *
1239  * # Attributes
1240  */
1241 
1242 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1243  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1244  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1245  cLinearOperator<float> *(*get_linear_operator_float)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1246  cLinearOperator<double> *(*get_linear_operator_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1247  cLinearOperator<long double> *(*get_linear_operator_long_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1248  void (*dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1249  void (*transpose_dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1250 };
1251 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1252 
1253 
1254 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":32
1255  * # ==========================
1256  *
1257  * cdef class pycAffineMatrixFunction(pycLinearOperator): # <<<<<<<<<<<<<<
1258  * """
1259  * Defines a linear operator that is an affine function of a single parameter.
1260  */
1261 
1262 struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction {
1263  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1264 };
1265 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
1266 
1267 
1268 /* "View.MemoryView":105
1269  *
1270  * @cname("__pyx_array")
1271  * cdef class array: # <<<<<<<<<<<<<<
1272  *
1273  * cdef:
1274  */
1275 
1276 struct __pyx_vtabstruct_array {
1277  PyObject *(*get_memview)(struct __pyx_array_obj *);
1278 };
1279 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1280 
1281 
1282 /* "View.MemoryView":330
1283  *
1284  * @cname('__pyx_memoryview')
1285  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1286  *
1287  * cdef object obj
1288  */
1289 
1290 struct __pyx_vtabstruct_memoryview {
1291  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1292  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1293  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1294  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1295  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1296  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1297  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1298 };
1299 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1300 
1301 
1302 /* "View.MemoryView":965
1303  *
1304  * @cname('__pyx_memoryviewslice')
1305  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1306  * "Internal class for passing memoryview slices to Python"
1307  *
1308  */
1309 
1310 struct __pyx_vtabstruct__memoryviewslice {
1311  struct __pyx_vtabstruct_memoryview __pyx_base;
1312 };
1313 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1314 
1315 /* --- Runtime support code (head) --- */
1316 /* Refnanny.proto */
1317 #ifndef CYTHON_REFNANNY
1318  #define CYTHON_REFNANNY 0
1319 #endif
1320 #if CYTHON_REFNANNY
1321  typedef struct {
1322  void (*INCREF)(void*, PyObject*, int);
1323  void (*DECREF)(void*, PyObject*, int);
1324  void (*GOTREF)(void*, PyObject*, int);
1325  void (*GIVEREF)(void*, PyObject*, int);
1326  void* (*SetupContext)(const char*, int, const char*);
1327  void (*FinishContext)(void**);
1328  } __Pyx_RefNannyAPIStruct;
1329  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1330  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1331  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1332 #ifdef WITH_THREAD
1333  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1334  if (acquire_gil) {\
1335  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1336  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1337  PyGILState_Release(__pyx_gilstate_save);\
1338  } else {\
1339  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1340  }
1341 #else
1342  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1343  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1344 #endif
1345  #define __Pyx_RefNannyFinishContext()\
1346  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1347  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1348  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1349  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1350  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1351  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1352  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1353  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1354  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1355 #else
1356  #define __Pyx_RefNannyDeclarations
1357  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1358  #define __Pyx_RefNannyFinishContext()
1359  #define __Pyx_INCREF(r) Py_INCREF(r)
1360  #define __Pyx_DECREF(r) Py_DECREF(r)
1361  #define __Pyx_GOTREF(r)
1362  #define __Pyx_GIVEREF(r)
1363  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1364  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1365  #define __Pyx_XGOTREF(r)
1366  #define __Pyx_XGIVEREF(r)
1367 #endif
1368 #define __Pyx_XDECREF_SET(r, v) do {\
1369  PyObject *tmp = (PyObject *) r;\
1370  r = v; __Pyx_XDECREF(tmp);\
1371  } while (0)
1372 #define __Pyx_DECREF_SET(r, v) do {\
1373  PyObject *tmp = (PyObject *) r;\
1374  r = v; __Pyx_DECREF(tmp);\
1375  } while (0)
1376 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1377 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1378 
1379 /* PyObjectGetAttrStr.proto */
1380 #if CYTHON_USE_TYPE_SLOTS
1381 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1382 #else
1383 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1384 #endif
1385 
1386 /* GetBuiltinName.proto */
1387 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1388 
1389 /* RaiseDoubleKeywords.proto */
1390 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1391 
1392 /* ParseKeywords.proto */
1393 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1394  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1395  const char* function_name);
1396 
1397 /* RaiseArgTupleInvalid.proto */
1398 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1399  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1400 
1401 /* PyThreadStateGet.proto */
1402 #if CYTHON_FAST_THREAD_STATE
1403 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1404 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1405 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1406 #else
1407 #define __Pyx_PyThreadState_declare
1408 #define __Pyx_PyThreadState_assign
1409 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1410 #endif
1411 
1412 /* PyErrFetchRestore.proto */
1413 #if CYTHON_FAST_THREAD_STATE
1414 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1415 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1416 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1417 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1418 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1419 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1420 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1421 #if CYTHON_COMPILING_IN_CPYTHON
1422 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1423 #else
1424 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1425 #endif
1426 #else
1427 #define __Pyx_PyErr_Clear() PyErr_Clear()
1428 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1429 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1430 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1431 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1432 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1433 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1434 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1435 #endif
1436 
1437 /* Profile.proto */
1438 #ifndef CYTHON_PROFILE
1439 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1440  #define CYTHON_PROFILE 0
1441 #else
1442  #define CYTHON_PROFILE 1
1443 #endif
1444 #endif
1445 #ifndef CYTHON_TRACE_NOGIL
1446  #define CYTHON_TRACE_NOGIL 0
1447 #else
1448  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1449  #define CYTHON_TRACE 1
1450  #endif
1451 #endif
1452 #ifndef CYTHON_TRACE
1453  #define CYTHON_TRACE 0
1454 #endif
1455 #if CYTHON_TRACE
1456  #undef CYTHON_PROFILE_REUSE_FRAME
1457 #endif
1458 #ifndef CYTHON_PROFILE_REUSE_FRAME
1459  #define CYTHON_PROFILE_REUSE_FRAME 0
1460 #endif
1461 #if CYTHON_PROFILE || CYTHON_TRACE
1462  #include "compile.h"
1463  #include "frameobject.h"
1464  #include "traceback.h"
1465  #if CYTHON_PROFILE_REUSE_FRAME
1466  #define CYTHON_FRAME_MODIFIER static
1467  #define CYTHON_FRAME_DEL(frame)
1468  #else
1469  #define CYTHON_FRAME_MODIFIER
1470  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1471  #endif
1472  #define __Pyx_TraceDeclarations\
1473  static PyCodeObject *__pyx_frame_code = NULL;\
1474  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1475  int __Pyx_use_tracing = 0;
1476  #define __Pyx_TraceFrameInit(codeobj)\
1477  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1478 #if PY_VERSION_HEX >= 0x030a00b1
1479  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1480  (unlikely((tstate)->cframe->use_tracing) &&\
1481  (!(check_tracing) || !(tstate)->tracing) &&\
1482  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1483  #define __Pyx_SetTracing(tstate, enable)\
1484  (tstate)->cframe->use_tracing = (enable)
1485 #else
1486  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1487  (unlikely((tstate)->use_tracing) &&\
1488  (!(check_tracing) || !(tstate)->tracing) &&\
1489  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1490  #define __Pyx_SetTracing(tstate, enable)\
1491  (tstate)->use_tracing = (enable)
1492 #endif
1493  #ifdef WITH_THREAD
1494  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1495  if (nogil) {\
1496  if (CYTHON_TRACE_NOGIL) {\
1497  PyThreadState *tstate;\
1498  PyGILState_STATE state = PyGILState_Ensure();\
1499  tstate = __Pyx_PyThreadState_Current;\
1500  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1501  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1502  }\
1503  PyGILState_Release(state);\
1504  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1505  }\
1506  } else {\
1507  PyThreadState* tstate = PyThreadState_GET();\
1508  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1509  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1510  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1511  }\
1512  }
1513  #else
1514  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1515  { PyThreadState* tstate = PyThreadState_GET();\
1516  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1517  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1518  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1519  }\
1520  }
1521  #endif
1522  #define __Pyx_TraceException()\
1523  if (likely(!__Pyx_use_tracing)); else {\
1524  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1525  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1526  tstate->tracing++;\
1527  __Pyx_SetTracing(tstate, 0);\
1528  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1529  if (exc_info) {\
1530  if (CYTHON_TRACE && tstate->c_tracefunc)\
1531  tstate->c_tracefunc(\
1532  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1533  tstate->c_profilefunc(\
1534  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1535  Py_DECREF(exc_info);\
1536  }\
1537  __Pyx_SetTracing(tstate, 1);\
1538  tstate->tracing--;\
1539  }\
1540  }
1541  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1542  PyObject *type, *value, *traceback;
1543  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1544  tstate->tracing++;
1545  __Pyx_SetTracing(tstate, 0);
1546  if (CYTHON_TRACE && tstate->c_tracefunc)
1547  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1548  if (tstate->c_profilefunc)
1549  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1550  CYTHON_FRAME_DEL(frame);
1551  __Pyx_SetTracing(tstate, 1);
1552  tstate->tracing--;
1553  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1554  }
1555  #ifdef WITH_THREAD
1556  #define __Pyx_TraceReturn(result, nogil)\
1557  if (likely(!__Pyx_use_tracing)); else {\
1558  if (nogil) {\
1559  if (CYTHON_TRACE_NOGIL) {\
1560  PyThreadState *tstate;\
1561  PyGILState_STATE state = PyGILState_Ensure();\
1562  tstate = __Pyx_PyThreadState_Current;\
1563  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1564  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1565  }\
1566  PyGILState_Release(state);\
1567  }\
1568  } else {\
1569  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1570  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1571  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1572  }\
1573  }\
1574  }
1575  #else
1576  #define __Pyx_TraceReturn(result, nogil)\
1577  if (likely(!__Pyx_use_tracing)); else {\
1578  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1579  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1580  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1581  }\
1582  }
1583  #endif
1584  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1585  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1586 #else
1587  #define __Pyx_TraceDeclarations
1588  #define __Pyx_TraceFrameInit(codeobj)
1589  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1590  #define __Pyx_TraceException()
1591  #define __Pyx_TraceReturn(result, nogil)
1592 #endif
1593 #if CYTHON_TRACE
1594  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1595  int ret;
1596  PyObject *type, *value, *traceback;
1597  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1598  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1599  tstate->tracing++;
1600  __Pyx_SetTracing(tstate, 0);
1601  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1602  __Pyx_SetTracing(tstate, 1);
1603  tstate->tracing--;
1604  if (likely(!ret)) {
1605  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1606  } else {
1607  Py_XDECREF(type);
1608  Py_XDECREF(value);
1609  Py_XDECREF(traceback);
1610  }
1611  return ret;
1612  }
1613  #ifdef WITH_THREAD
1614  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1615  if (likely(!__Pyx_use_tracing)); else {\
1616  if (nogil) {\
1617  if (CYTHON_TRACE_NOGIL) {\
1618  int ret = 0;\
1619  PyThreadState *tstate;\
1620  PyGILState_STATE state = PyGILState_Ensure();\
1621  tstate = __Pyx_PyThreadState_Current;\
1622  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1623  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1624  }\
1625  PyGILState_Release(state);\
1626  if (unlikely(ret)) goto_error;\
1627  }\
1628  } else {\
1629  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1630  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1631  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1632  if (unlikely(ret)) goto_error;\
1633  }\
1634  }\
1635  }
1636  #else
1637  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1638  if (likely(!__Pyx_use_tracing)); else {\
1639  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1640  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1641  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1642  if (unlikely(ret)) goto_error;\
1643  }\
1644  }
1645  #endif
1646 #else
1647  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1648 #endif
1649 
1650 /* PyObjectCall.proto */
1651 #if CYTHON_COMPILING_IN_CPYTHON
1652 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1653 #else
1654 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1655 #endif
1656 
1657 /* RaiseException.proto */
1658 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1659 
1660 /* PyIntCompare.proto */
1661 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1662 
1663 /* IncludeStringH.proto */
1664 #include <string.h>
1665 
1666 /* BytesEquals.proto */
1667 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1668 
1669 /* PyDictVersioning.proto */
1670 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1671 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1672 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1673 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1674  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1675  (cache_var) = (value);
1676 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1677  static PY_UINT64_T __pyx_dict_version = 0;\
1678  static PyObject *__pyx_dict_cached_value = NULL;\
1679  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1680  (VAR) = __pyx_dict_cached_value;\
1681  } else {\
1682  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1683  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1684  }\
1685 }
1686 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1687 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1688 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1689 #else
1690 #define __PYX_GET_DICT_VERSION(dict) (0)
1691 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1692 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1693 #endif
1694 
1695 /* GetModuleGlobalName.proto */
1696 #if CYTHON_USE_DICT_VERSIONS
1697 #define __Pyx_GetModuleGlobalName(var, name) {\
1698  static PY_UINT64_T __pyx_dict_version = 0;\
1699  static PyObject *__pyx_dict_cached_value = NULL;\
1700  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1701  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1702  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1703 }
1704 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1705  PY_UINT64_T __pyx_dict_version;\
1706  PyObject *__pyx_dict_cached_value;\
1707  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1708 }
1709 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1710 #else
1711 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1712 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1713 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1714 #endif
1715 
1716 /* PyCFunctionFastCall.proto */
1717 #if CYTHON_FAST_PYCCALL
1718 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1719 #else
1720 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1721 #endif
1722 
1723 /* PyFunctionFastCall.proto */
1724 #if CYTHON_FAST_PYCALL
1725 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1726  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1727 #if 1 || PY_VERSION_HEX < 0x030600B1
1728 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1729 #else
1730 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1731 #endif
1732 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1733  (sizeof(char [1 - 2*!(cond)]) - 1)
1734 #ifndef Py_MEMBER_SIZE
1735 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1736 #endif
1737  static size_t __pyx_pyframe_localsplus_offset = 0;
1738  #include "frameobject.h"
1739  #define __Pxy_PyFrame_Initialize_Offsets()\
1740  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1741  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1742  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1743  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1744 #endif
1745 
1746 /* PyObjectCall2Args.proto */
1747 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1748 
1749 /* PyObjectCallMethO.proto */
1750 #if CYTHON_COMPILING_IN_CPYTHON
1751 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1752 #endif
1753 
1754 /* PyObjectCallOneArg.proto */
1755 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1756 
1757 /* PyObjectCallNoArg.proto */
1758 #if CYTHON_COMPILING_IN_CPYTHON
1759 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1760 #else
1761 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1762 #endif
1763 
1764 /* GetItemInt.proto */
1765 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1766  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1767  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1768  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1769  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1770 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1771  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1772  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1773  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1774 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1775  int wraparound, int boundscheck);
1776 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1777  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1778  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1779  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1780 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1781  int wraparound, int boundscheck);
1782 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1783 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1784  int is_list, int wraparound, int boundscheck);
1785 
1786 /* DictGetItem.proto */
1787 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1788 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1789 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1790  (likely(PyDict_CheckExact(obj)) ?\
1791  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1792 #else
1793 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1794 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1795 #endif
1796 
1797 /* MemviewSliceInit.proto */
1798 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1799 #define __Pyx_MEMVIEW_DIRECT 1
1800 #define __Pyx_MEMVIEW_PTR 2
1801 #define __Pyx_MEMVIEW_FULL 4
1802 #define __Pyx_MEMVIEW_CONTIG 8
1803 #define __Pyx_MEMVIEW_STRIDED 16
1804 #define __Pyx_MEMVIEW_FOLLOW 32
1805 #define __Pyx_IS_C_CONTIG 1
1806 #define __Pyx_IS_F_CONTIG 2
1807 static int __Pyx_init_memviewslice(
1808  struct __pyx_memoryview_obj *memview,
1809  int ndim,
1810  __Pyx_memviewslice *memviewslice,
1811  int memview_is_new_reference);
1812 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1813  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1814 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1815  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1816 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1817 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1818 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1819 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1820 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1821 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1822 
1823 /* ArgTypeTest.proto */
1824 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1825  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1826  __Pyx__ArgTypeTest(obj, type, name, exact))
1827 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1828 
1829 /* UnicodeEquals.proto */
1830 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1831 
1832 /* StrEquals.proto */
1833 #if PY_MAJOR_VERSION >= 3
1834 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1835 #else
1836 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1837 #endif
1838 
1839 /* UnaryNegOverflows.proto */
1840 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1841  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1842 
1843 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1844 /* WriteUnraisableException.proto */
1845 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1846  int lineno, const char *filename,
1847  int full_traceback, int nogil);
1848 
1849 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1850 /* GetAttr.proto */
1851 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1852 
1853 /* ObjectGetItem.proto */
1854 #if CYTHON_USE_TYPE_SLOTS
1855 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1856 #else
1857 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1858 #endif
1859 
1860 /* decode_c_string_utf16.proto */
1861 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1862  int byteorder = 0;
1863  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1864 }
1865 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1866  int byteorder = -1;
1867  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1868 }
1869 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1870  int byteorder = 1;
1871  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1872 }
1873 
1874 /* decode_c_string.proto */
1875 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1876  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1877  const char* encoding, const char* errors,
1878  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1879 
1880 /* PyErrExceptionMatches.proto */
1881 #if CYTHON_FAST_THREAD_STATE
1882 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1883 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1884 #else
1885 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1886 #endif
1887 
1888 /* GetAttr3.proto */
1889 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1890 
1891 /* RaiseTooManyValuesToUnpack.proto */
1892 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1893 
1894 /* RaiseNeedMoreValuesToUnpack.proto */
1895 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1896 
1897 /* RaiseNoneIterError.proto */
1898 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1899 
1900 /* ExtTypeTest.proto */
1901 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1902 
1903 /* GetTopmostException.proto */
1904 #if CYTHON_USE_EXC_INFO_STACK
1905 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1906 #endif
1907 
1908 /* SaveResetException.proto */
1909 #if CYTHON_FAST_THREAD_STATE
1910 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1911 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1912 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1913 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1914 #else
1915 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1916 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1917 #endif
1918 
1919 /* GetException.proto */
1920 #if CYTHON_FAST_THREAD_STATE
1921 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1922 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1923 #else
1924 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1925 #endif
1926 
1927 /* SwapException.proto */
1928 #if CYTHON_FAST_THREAD_STATE
1929 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1930 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1931 #else
1932 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1933 #endif
1934 
1935 /* Import.proto */
1936 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1937 
1938 /* FastTypeChecks.proto */
1939 #if CYTHON_COMPILING_IN_CPYTHON
1940 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1941 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1942 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1943 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1944 #else
1945 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1946 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1947 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1948 #endif
1949 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1950 
1951 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1952 /* ListCompAppend.proto */
1953 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1954 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1955  PyListObject* L = (PyListObject*) list;
1956  Py_ssize_t len = Py_SIZE(list);
1957  if (likely(L->allocated > len)) {
1958  Py_INCREF(x);
1959  PyList_SET_ITEM(list, len, x);
1960  __Pyx_SET_SIZE(list, len + 1);
1961  return 0;
1962  }
1963  return PyList_Append(list, x);
1964 }
1965 #else
1966 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1967 #endif
1968 
1969 /* PyIntBinop.proto */
1970 #if !CYTHON_COMPILING_IN_PYPY
1971 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1972 #else
1973 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1974  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1975 #endif
1976 
1977 /* ListExtend.proto */
1978 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1979 #if CYTHON_COMPILING_IN_CPYTHON
1980  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1981  if (unlikely(!none))
1982  return -1;
1983  Py_DECREF(none);
1984  return 0;
1985 #else
1986  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1987 #endif
1988 }
1989 
1990 /* ListAppend.proto */
1991 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1992 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1993  PyListObject* L = (PyListObject*) list;
1994  Py_ssize_t len = Py_SIZE(list);
1995  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1996  Py_INCREF(x);
1997  PyList_SET_ITEM(list, len, x);
1998  __Pyx_SET_SIZE(list, len + 1);
1999  return 0;
2000  }
2001  return PyList_Append(list, x);
2002 }
2003 #else
2004 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2005 #endif
2006 
2007 /* None.proto */
2008 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2009 
2010 /* ImportFrom.proto */
2011 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2012 
2013 /* HasAttr.proto */
2014 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2015 
2016 /* CallNextTpDealloc.proto */
2017 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2018 
2019 /* CallNextTpTraverse.proto */
2020 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2021 
2022 /* CallNextTpClear.proto */
2023 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2024 
2025 /* PyObject_GenericGetAttrNoDict.proto */
2026 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2027 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2028 #else
2029 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2030 #endif
2031 
2032 /* PyObject_GenericGetAttr.proto */
2033 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2034 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2035 #else
2036 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2037 #endif
2038 
2039 /* TypeImport.proto */
2040 #ifndef __PYX_HAVE_RT_ImportType_proto
2041 #define __PYX_HAVE_RT_ImportType_proto
2042 enum __Pyx_ImportType_CheckSize {
2043  __Pyx_ImportType_CheckSize_Error = 0,
2044  __Pyx_ImportType_CheckSize_Warn = 1,
2045  __Pyx_ImportType_CheckSize_Ignore = 2
2046 };
2047 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2048 #endif
2049 
2050 /* GetVTable.proto */
2051 static void* __Pyx_GetVtable(PyObject *dict);
2052 
2053 /* SetVTable.proto */
2054 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2055 
2056 /* PyObjectGetAttrStrNoError.proto */
2057 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2058 
2059 /* SetupReduce.proto */
2060 static int __Pyx_setup_reduce(PyObject* type_obj);
2061 
2062 /* FetchCommonType.proto */
2063 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2064 
2065 /* CythonFunctionShared.proto */
2066 #define __Pyx_CyFunction_USED 1
2067 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2068 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2069 #define __Pyx_CYFUNCTION_CCLASS 0x04
2070 #define __Pyx_CyFunction_GetClosure(f)\
2071  (((__pyx_CyFunctionObject *) (f))->func_closure)
2072 #define __Pyx_CyFunction_GetClassObj(f)\
2073  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2074 #define __Pyx_CyFunction_Defaults(type, f)\
2075  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2076 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2077  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2078 typedef struct {
2079  PyCFunctionObject func;
2080 #if PY_VERSION_HEX < 0x030500A0
2081  PyObject *func_weakreflist;
2082 #endif
2083  PyObject *func_dict;
2084  PyObject *func_name;
2085  PyObject *func_qualname;
2086  PyObject *func_doc;
2087  PyObject *func_globals;
2088  PyObject *func_code;
2089  PyObject *func_closure;
2090  PyObject *func_classobj;
2091  void *defaults;
2092  int defaults_pyobjects;
2093  size_t defaults_size; // used by FusedFunction for copying defaults
2094  int flags;
2095  PyObject *defaults_tuple;
2096  PyObject *defaults_kwdict;
2097  PyObject *(*defaults_getter)(PyObject *);
2098  PyObject *func_annotations;
2099 } __pyx_CyFunctionObject;
2100 static PyTypeObject *__pyx_CyFunctionType = 0;
2101 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2102 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2103  int flags, PyObject* qualname,
2104  PyObject *self,
2105  PyObject *module, PyObject *globals,
2106  PyObject* code);
2107 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2108  size_t size,
2109  int pyobjects);
2110 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2111  PyObject *tuple);
2112 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2113  PyObject *dict);
2114 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2115  PyObject *dict);
2116 static int __pyx_CyFunction_init(void);
2117 
2118 /* CythonFunction.proto */
2119 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2120  int flags, PyObject* qualname,
2121  PyObject *closure,
2122  PyObject *module, PyObject *globals,
2123  PyObject* code);
2124 
2125 /* CLineInTraceback.proto */
2126 #ifdef CYTHON_CLINE_IN_TRACEBACK
2127 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2128 #else
2129 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2130 #endif
2131 
2132 /* CodeObjectCache.proto */
2133 typedef struct {
2134  PyCodeObject* code_object;
2135  int code_line;
2136 } __Pyx_CodeObjectCacheEntry;
2137 struct __Pyx_CodeObjectCache {
2138  int count;
2139  int max_count;
2140  __Pyx_CodeObjectCacheEntry* entries;
2141 };
2142 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2143 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2144 static PyCodeObject *__pyx_find_code_object(int code_line);
2145 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2146 
2147 /* AddTraceback.proto */
2148 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2149  int py_line, const char *filename);
2150 
2151 #if PY_MAJOR_VERSION < 3
2152  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2153  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2154 #else
2155  #define __Pyx_GetBuffer PyObject_GetBuffer
2156  #define __Pyx_ReleaseBuffer PyBuffer_Release
2157 #endif
2158 
2159 
2160 /* BufferStructDeclare.proto */
2161 typedef struct {
2162  Py_ssize_t shape, strides, suboffsets;
2163 } __Pyx_Buf_DimInfo;
2164 typedef struct {
2165  size_t refcount;
2166  Py_buffer pybuffer;
2167 } __Pyx_Buffer;
2168 typedef struct {
2169  __Pyx_Buffer *rcbuffer;
2170  char *data;
2171  __Pyx_Buf_DimInfo diminfo[8];
2172 } __Pyx_LocalBuf_ND;
2173 
2174 /* MemviewSliceIsContig.proto */
2175 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2176 
2177 /* OverlappingSlices.proto */
2178 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2179  __Pyx_memviewslice *slice2,
2180  int ndim, size_t itemsize);
2181 
2182 /* Capsule.proto */
2183 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2184 
2185 /* GCCDiagnostics.proto */
2186 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2187 #define __Pyx_HAS_GCC_DIAGNOSTIC
2188 #endif
2189 
2190 /* IsLittleEndian.proto */
2191 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2192 
2193 /* BufferFormatCheck.proto */
2194 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2195 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2196  __Pyx_BufFmt_StackElem* stack,
2197  __Pyx_TypeInfo* type);
2198 
2199 /* TypeInfoCompare.proto */
2200 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2201 
2202 /* MemviewSliceValidateAndInit.proto */
2203 static int __Pyx_ValidateAndInit_memviewslice(
2204  int *axes_specs,
2205  int c_or_f_flag,
2206  int buf_flags,
2207  int ndim,
2208  __Pyx_TypeInfo *dtype,
2209  __Pyx_BufFmt_StackElem stack[],
2210  __Pyx_memviewslice *memviewslice,
2211  PyObject *original_obj);
2212 
2213 /* ObjectToMemviewSlice.proto */
2214 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag);
2215 
2216 /* ObjectToMemviewSlice.proto */
2217 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *, int writable_flag);
2218 
2219 /* CppExceptionConversion.proto */
2220 #ifndef __Pyx_CppExn2PyErr
2221 #include <new>
2222 #include <typeinfo>
2223 #include <stdexcept>
2224 #include <ios>
2225 static void __Pyx_CppExn2PyErr() {
2226  try {
2227  if (PyErr_Occurred())
2228  ; // let the latest Python exn pass through and ignore the current one
2229  else
2230  throw;
2231  } catch (const std::bad_alloc& exn) {
2232  PyErr_SetString(PyExc_MemoryError, exn.what());
2233  } catch (const std::bad_cast& exn) {
2234  PyErr_SetString(PyExc_TypeError, exn.what());
2235  } catch (const std::bad_typeid& exn) {
2236  PyErr_SetString(PyExc_TypeError, exn.what());
2237  } catch (const std::domain_error& exn) {
2238  PyErr_SetString(PyExc_ValueError, exn.what());
2239  } catch (const std::invalid_argument& exn) {
2240  PyErr_SetString(PyExc_ValueError, exn.what());
2241  } catch (const std::ios_base::failure& exn) {
2242  PyErr_SetString(PyExc_IOError, exn.what());
2243  } catch (const std::out_of_range& exn) {
2244  PyErr_SetString(PyExc_IndexError, exn.what());
2245  } catch (const std::overflow_error& exn) {
2246  PyErr_SetString(PyExc_OverflowError, exn.what());
2247  } catch (const std::range_error& exn) {
2248  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2249  } catch (const std::underflow_error& exn) {
2250  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2251  } catch (const std::exception& exn) {
2252  PyErr_SetString(PyExc_RuntimeError, exn.what());
2253  }
2254  catch (...)
2255  {
2256  PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
2257  }
2258 }
2259 #endif
2260 
2261 /* ObjectToMemviewSlice.proto */
2262 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2263 
2264 /* ObjectToMemviewSlice.proto */
2265 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag);
2266 
2267 /* ObjectToMemviewSlice.proto */
2268 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *, int writable_flag);
2269 
2270 /* ObjectToMemviewSlice.proto */
2271 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *, int writable_flag);
2272 
2273 /* ObjectToMemviewSlice.proto */
2274 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2275 
2276 /* ObjectToMemviewSlice.proto */
2277 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2278 
2279 /* ObjectToMemviewSlice.proto */
2280 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2281 
2282 /* ObjectToMemviewSlice.proto */
2283 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *, int writable_flag);
2284 
2285 /* MemviewSliceCopyTemplate.proto */
2286 static __Pyx_memviewslice
2287 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2288  const char *mode, int ndim,
2289  size_t sizeof_dtype, int contig_flag,
2290  int dtype_is_object);
2291 
2292 /* CIntToPy.proto */
2293 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2294 
2295 /* CIntFromPy.proto */
2296 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2297 
2298 /* CIntFromPy.proto */
2299 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2300 
2301 /* CIntToPy.proto */
2302 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2303 
2304 /* CIntFromPy.proto */
2305 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2306 
2307 /* CheckBinaryVersion.proto */
2308 static int __Pyx_check_binary_version(void);
2309 
2310 /* InitStrings.proto */
2311 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2312 
2313 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2314 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2315 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2316 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2317 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2318 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2319 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2320 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2321 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2322 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2323 
2324 /* Module declarations from 'imate._definitions.types' */
2325 
2326 /* Module declarations from 'imate._c_linear_operator.c_linear_operator' */
2327 
2328 /* Module declarations from 'imate._c_linear_operator.py_c_linear_operator' */
2329 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2330 
2331 /* Module declarations from 'imate._c_linear_operator.c_affine_matrix_function' */
2332 
2333 /* Module declarations from 'imate._c_linear_operator.c_dense_affine_matrix_function' */
2334 
2335 /* Module declarations from 'imate._c_linear_operator.c_csr_affine_matrix_function' */
2336 
2337 /* Module declarations from 'imate._c_linear_operator.c_csc_affine_matrix_function' */
2338 
2339 /* Module declarations from 'imate._c_linear_operator.py_c_affine_matrix_function' */
2340 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = 0;
2341 static PyTypeObject *__pyx_array_type = 0;
2342 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2343 static PyTypeObject *__pyx_memoryview_type = 0;
2344 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2345 static PyObject *generic = 0;
2346 static PyObject *strided = 0;
2347 static PyObject *indirect = 0;
2348 static PyObject *contiguous = 0;
2349 static PyObject *indirect_contiguous = 0;
2350 static int __pyx_memoryview_thread_locks_used;
2351 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2352 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2353 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2354 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2355 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2356 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2357 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2358 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2359 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2360 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2361 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2362 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2363 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2364 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2365 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2366 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2367 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2368 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2369 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2370 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2371 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2372 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2373 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2374 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2375 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2376 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2377 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2378 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2379 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2380 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2381 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2382 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2383 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2384 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2385 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2386 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2387 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = { "long double", NULL, sizeof(long double), { 0 }, 0, 'R', 0, 0 };
2388 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2389 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_affine_matrix_function"
2390 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function;
2391 int __pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function = 0;
2392 
2393 /* Implementation of 'imate._c_linear_operator.py_c_affine_matrix_function' */
2394 static PyObject *__pyx_builtin_ValueError;
2395 static PyObject *__pyx_builtin_TypeError;
2396 static PyObject *__pyx_builtin_MemoryError;
2397 static PyObject *__pyx_builtin_enumerate;
2398 static PyObject *__pyx_builtin_range;
2399 static PyObject *__pyx_builtin_Ellipsis;
2400 static PyObject *__pyx_builtin_id;
2401 static PyObject *__pyx_builtin_IndexError;
2402 static const char __pyx_k_A[] = "A";
2403 static const char __pyx_k_B[] = "B";
2404 static const char __pyx_k_O[] = "O";
2405 static const char __pyx_k_c[] = "c";
2406 static const char __pyx_k_id[] = "id";
2407 static const char __pyx_k_new[] = "__new__";
2408 static const char __pyx_k_obj[] = "obj";
2409 static const char __pyx_k_base[] = "base";
2410 static const char __pyx_k_copy[] = "copy";
2411 static const char __pyx_k_data[] = "data";
2412 static const char __pyx_k_dict[] = "__dict__";
2413 static const char __pyx_k_main[] = "__main__";
2414 static const char __pyx_k_mode[] = "mode";
2415 static const char __pyx_k_name[] = "name";
2416 static const char __pyx_k_ndim[] = "ndim";
2417 static const char __pyx_k_pack[] = "pack";
2418 static const char __pyx_k_self[] = "self";
2419 static const char __pyx_k_size[] = "size";
2420 static const char __pyx_k_step[] = "step";
2421 static const char __pyx_k_stop[] = "stop";
2422 static const char __pyx_k_test[] = "__test__";
2423 static const char __pyx_k_ASCII[] = "ASCII";
2424 static const char __pyx_k_class[] = "__class__";
2425 static const char __pyx_k_dtype[] = "dtype";
2426 static const char __pyx_k_error[] = "error";
2427 static const char __pyx_k_flags[] = "flags";
2428 static const char __pyx_k_numpy[] = "numpy";
2429 static const char __pyx_k_range[] = "range";
2430 static const char __pyx_k_shape[] = "shape";
2431 static const char __pyx_k_start[] = "start";
2432 static const char __pyx_k_A_data[] = "A_data";
2433 static const char __pyx_k_B_data[] = "B_data";
2434 static const char __pyx_k_astype[] = "astype";
2435 static const char __pyx_k_encode[] = "encode";
2436 static const char __pyx_k_format[] = "format";
2437 static const char __pyx_k_import[] = "__import__";
2438 static const char __pyx_k_indptr[] = "indptr";
2439 static const char __pyx_k_name_2[] = "__name__";
2440 static const char __pyx_k_pickle[] = "pickle";
2441 static const char __pyx_k_reduce[] = "__reduce__";
2442 static const char __pyx_k_struct[] = "struct";
2443 static const char __pyx_k_unpack[] = "unpack";
2444 static const char __pyx_k_update[] = "update";
2445 static const char __pyx_k_float32[] = "float32";
2446 static const char __pyx_k_float64[] = "float64";
2447 static const char __pyx_k_fortran[] = "fortran";
2448 static const char __pyx_k_indices[] = "indices";
2449 static const char __pyx_k_memview[] = "memview";
2450 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2451 static const char __pyx_k_float128[] = "float128";
2452 static const char __pyx_k_getstate[] = "__getstate__";
2453 static const char __pyx_k_issparse[] = "issparse";
2454 static const char __pyx_k_itemsize[] = "itemsize";
2455 static const char __pyx_k_pyx_type[] = "__pyx_type";
2456 static const char __pyx_k_setstate[] = "__setstate__";
2457 static const char __pyx_k_A_data_mv[] = "A_data_mv";
2458 static const char __pyx_k_A_indices[] = "A_indices";
2459 static const char __pyx_k_B_data_mv[] = "B_data_mv";
2460 static const char __pyx_k_B_indices[] = "B_indices";
2461 static const char __pyx_k_TypeError[] = "TypeError";
2462 static const char __pyx_k_enumerate[] = "enumerate";
2463 static const char __pyx_k_pyx_state[] = "__pyx_state";
2464 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2465 static const char __pyx_k_A_num_rows[] = "A_num_rows";
2466 static const char __pyx_k_IndexError[] = "IndexError";
2467 static const char __pyx_k_ValueError[] = "ValueError";
2468 static const char __pyx_k_csr_matrix[] = "csr_matrix";
2469 static const char __pyx_k_pyx_result[] = "__pyx_result";
2470 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2471 static const char __pyx_k_A_data_mv_c[] = "A_data_mv_c";
2472 static const char __pyx_k_A_data_mv_f[] = "A_data_mv_f";
2473 static const char __pyx_k_B_data_mv_c[] = "B_data_mv_c";
2474 static const char __pyx_k_B_data_mv_f[] = "B_data_mv_f";
2475 static const char __pyx_k_MemoryError[] = "MemoryError";
2476 static const char __pyx_k_PickleError[] = "PickleError";
2477 static const char __pyx_k_A_indices_mv[] = "A_indices_mv";
2478 static const char __pyx_k_B_indices_mv[] = "B_indices_mv";
2479 static const char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
2480 static const char __pyx_k_F_CONTIGUOUS[] = "F_CONTIGUOUS";
2481 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2482 static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
2483 static const char __pyx_k_sort_indices[] = "sort_indices";
2484 static const char __pyx_k_stringsource[] = "stringsource";
2485 static const char __pyx_k_A_num_columns[] = "A_num_columns";
2486 static const char __pyx_k_B_is_identity[] = "B_is_identity";
2487 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2488 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2489 static const char __pyx_k_A_is_row_major[] = "A_is_row_major";
2490 static const char __pyx_k_B_is_row_major[] = "B_is_row_major";
2491 static const char __pyx_k_isspmatrix_csc[] = "isspmatrix_csc";
2492 static const char __pyx_k_isspmatrix_csr[] = "isspmatrix_csr";
2493 static const char __pyx_k_A_index_pointer[] = "A_index_pointer";
2494 static const char __pyx_k_B_index_pointer[] = "B_index_pointer";
2495 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2496 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2497 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2498 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2499 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2500 static const char __pyx_k_A_cannot_be_None[] = "A cannot be None.";
2501 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2502 static const char __pyx_k_A_index_pointer_mv[] = "A_index_pointer_mv";
2503 static const char __pyx_k_B_index_pointer_mv[] = "B_index_pointer_mv";
2504 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2505 static const char __pyx_k_has_sorted_indices[] = "has_sorted_indices";
2506 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2507 static const char __pyx_k_set_csc_matrix_float[] = "set_csc_matrix_float";
2508 static const char __pyx_k_set_csr_matrix_float[] = "set_csr_matrix_float";
2509 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2510 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2511 static const char __pyx_k_set_csc_matrix_double[] = "set_csc_matrix_double";
2512 static const char __pyx_k_set_csr_matrix_double[] = "set_csr_matrix_double";
2513 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2514 static const char __pyx_k_set_dense_matrix_float[] = "set_dense_matrix_float";
2515 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2516 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2517 static const char __pyx_k_pycAffineMatrixFunction[] = "pycAffineMatrixFunction";
2518 static const char __pyx_k_set_dense_matrix_double[] = "set_dense_matrix_double";
2519 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2520 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2521 static const char __pyx_k_set_csc_matrix_long_double[] = "set_csc_matrix_long_double";
2522 static const char __pyx_k_set_csr_matrix_long_double[] = "set_csr_matrix_long_double";
2523 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2524 static const char __pyx_k_set_dense_matrix_long_double[] = "set_dense_matrix_long_double";
2525 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2526 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2527 static const char __pyx_k_pycAffineMatrixFunction_set_csc[] = "pycAffineMatrixFunction.set_csc_matrix_float";
2528 static const char __pyx_k_pycAffineMatrixFunction_set_csr[] = "pycAffineMatrixFunction.set_csr_matrix_float";
2529 static const char __pyx_k_A_and_B_should_have_similar_data[] = "A and B should have similar data types.";
2530 static const char __pyx_k_A_and_B_should_have_the_same_sha[] = "A and B should have the same shape.";
2531 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2532 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2533 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2534 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2535 static const char __pyx_k_Data_type_should_be_float32_floa[] = "Data type should be float32, float64, or float128.";
2536 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2537 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2538 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2539 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] = "Input matrix should be a 2-dimensional array.";
2540 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2541 static const char __pyx_k_Matrices_A_and_B_should_have_sim[] = "Matrices A and B should have similar types.";
2542 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] = "Matrix A should be either C or F contiguous.";
2543 static const char __pyx_k_Matrix_B_should_be_either_C_or_F[] = "Matrix B should be either C or F contiguous.";
2544 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2545 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2546 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2547 static const char __pyx_k_imate__c_linear_operator_py_c_af[] = "imate/_c_linear_operator/py_c_affine_matrix_function.pyx";
2548 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2549 static const char __pyx_k_pycAffineMatrixFunction___reduce[] = "pycAffineMatrixFunction.__reduce_cython__";
2550 static const char __pyx_k_pycAffineMatrixFunction___setsta[] = "pycAffineMatrixFunction.__setstate_cython__";
2551 static const char __pyx_k_pycAffineMatrixFunction_set_dens[] = "pycAffineMatrixFunction.set_dense_matrix_float";
2552 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2553 static const char __pyx_k_pycAffineMatrixFunction_set_csc_2[] = "pycAffineMatrixFunction.set_csc_matrix_double";
2554 static const char __pyx_k_pycAffineMatrixFunction_set_csc_3[] = "pycAffineMatrixFunction.set_csc_matrix_long_double";
2555 static const char __pyx_k_pycAffineMatrixFunction_set_csr_2[] = "pycAffineMatrixFunction.set_csr_matrix_double";
2556 static const char __pyx_k_pycAffineMatrixFunction_set_csr_3[] = "pycAffineMatrixFunction.set_csr_matrix_long_double";
2557 static const char __pyx_k_imate__c_linear_operator_py_c_af_2[] = "imate._c_linear_operator.py_c_affine_matrix_function";
2558 static const char __pyx_k_pycAffineMatrixFunction_set_dens_2[] = "pycAffineMatrixFunction.set_dense_matrix_double";
2559 static const char __pyx_k_pycAffineMatrixFunction_set_dens_3[] = "pycAffineMatrixFunction.set_dense_matrix_long_double";
2560 static PyObject *__pyx_n_s_A;
2561 static PyObject *__pyx_n_s_ASCII;
2562 static PyObject *__pyx_kp_u_A_and_B_should_have_similar_data;
2563 static PyObject *__pyx_kp_u_A_and_B_should_have_the_same_sha;
2564 static PyObject *__pyx_kp_u_A_cannot_be_None;
2565 static PyObject *__pyx_n_s_A_data;
2566 static PyObject *__pyx_n_s_A_data_mv;
2567 static PyObject *__pyx_n_s_A_data_mv_c;
2568 static PyObject *__pyx_n_s_A_data_mv_f;
2569 static PyObject *__pyx_n_s_A_index_pointer;
2570 static PyObject *__pyx_n_s_A_index_pointer_mv;
2571 static PyObject *__pyx_n_s_A_indices;
2572 static PyObject *__pyx_n_s_A_indices_mv;
2573 static PyObject *__pyx_n_s_A_is_row_major;
2574 static PyObject *__pyx_n_s_A_num_columns;
2575 static PyObject *__pyx_n_s_A_num_rows;
2576 static PyObject *__pyx_n_s_B;
2577 static PyObject *__pyx_n_s_B_data;
2578 static PyObject *__pyx_n_s_B_data_mv;
2579 static PyObject *__pyx_n_s_B_data_mv_c;
2580 static PyObject *__pyx_n_s_B_data_mv_f;
2581 static PyObject *__pyx_n_s_B_index_pointer;
2582 static PyObject *__pyx_n_s_B_index_pointer_mv;
2583 static PyObject *__pyx_n_s_B_indices;
2584 static PyObject *__pyx_n_s_B_indices_mv;
2585 static PyObject *__pyx_n_s_B_is_identity;
2586 static PyObject *__pyx_n_s_B_is_row_major;
2587 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2588 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2589 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2590 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2591 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2592 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2593 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2594 static PyObject *__pyx_n_s_Ellipsis;
2595 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2596 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2597 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2598 static PyObject *__pyx_n_s_IndexError;
2599 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2600 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2601 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2602 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2603 static PyObject *__pyx_kp_u_Matrices_A_and_B_should_have_sim;
2604 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2605 static PyObject *__pyx_kp_u_Matrix_B_should_be_either_C_or_F;
2606 static PyObject *__pyx_n_s_MemoryError;
2607 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2608 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2609 static PyObject *__pyx_n_b_O;
2610 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2611 static PyObject *__pyx_n_s_PickleError;
2612 static PyObject *__pyx_n_s_TypeError;
2613 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2614 static PyObject *__pyx_n_s_ValueError;
2615 static PyObject *__pyx_n_s_View_MemoryView;
2616 static PyObject *__pyx_n_s_allocate_buffer;
2617 static PyObject *__pyx_n_s_astype;
2618 static PyObject *__pyx_n_s_base;
2619 static PyObject *__pyx_n_s_c;
2620 static PyObject *__pyx_n_u_c;
2621 static PyObject *__pyx_n_s_class;
2622 static PyObject *__pyx_n_s_cline_in_traceback;
2623 static PyObject *__pyx_kp_s_contiguous_and_direct;
2624 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2625 static PyObject *__pyx_n_s_copy;
2626 static PyObject *__pyx_n_s_csr_matrix;
2627 static PyObject *__pyx_n_s_data;
2628 static PyObject *__pyx_n_s_dict;
2629 static PyObject *__pyx_n_s_dtype;
2630 static PyObject *__pyx_n_s_dtype_is_object;
2631 static PyObject *__pyx_n_s_encode;
2632 static PyObject *__pyx_n_s_enumerate;
2633 static PyObject *__pyx_n_s_error;
2634 static PyObject *__pyx_n_s_flags;
2635 static PyObject *__pyx_n_b_float128;
2636 static PyObject *__pyx_n_b_float32;
2637 static PyObject *__pyx_n_b_float64;
2638 static PyObject *__pyx_n_s_format;
2639 static PyObject *__pyx_n_s_fortran;
2640 static PyObject *__pyx_n_u_fortran;
2641 static PyObject *__pyx_n_s_getstate;
2642 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2643 static PyObject *__pyx_n_s_has_sorted_indices;
2644 static PyObject *__pyx_n_s_id;
2645 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_af;
2646 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_af_2;
2647 static PyObject *__pyx_n_s_import;
2648 static PyObject *__pyx_n_s_indices;
2649 static PyObject *__pyx_n_s_indptr;
2650 static PyObject *__pyx_n_s_issparse;
2651 static PyObject *__pyx_n_s_isspmatrix_csc;
2652 static PyObject *__pyx_n_s_isspmatrix_csr;
2653 static PyObject *__pyx_n_s_itemsize;
2654 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2655 static PyObject *__pyx_n_s_main;
2656 static PyObject *__pyx_n_s_memview;
2657 static PyObject *__pyx_n_s_mode;
2658 static PyObject *__pyx_n_s_name;
2659 static PyObject *__pyx_n_s_name_2;
2660 static PyObject *__pyx_n_s_ndim;
2661 static PyObject *__pyx_n_s_new;
2662 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2663 static PyObject *__pyx_n_s_numpy;
2664 static PyObject *__pyx_n_s_obj;
2665 static PyObject *__pyx_n_s_pack;
2666 static PyObject *__pyx_n_s_pickle;
2667 static PyObject *__pyx_n_s_pycAffineMatrixFunction;
2668 static PyObject *__pyx_n_s_pycAffineMatrixFunction___reduce;
2669 static PyObject *__pyx_n_s_pycAffineMatrixFunction___setsta;
2670 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc;
2671 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_2;
2672 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csc_3;
2673 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr;
2674 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_2;
2675 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_csr_3;
2676 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens;
2677 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_2;
2678 static PyObject *__pyx_n_s_pycAffineMatrixFunction_set_dens_3;
2679 static PyObject *__pyx_n_s_pyx_PickleError;
2680 static PyObject *__pyx_n_s_pyx_checksum;
2681 static PyObject *__pyx_n_s_pyx_getbuffer;
2682 static PyObject *__pyx_n_s_pyx_result;
2683 static PyObject *__pyx_n_s_pyx_state;
2684 static PyObject *__pyx_n_s_pyx_type;
2685 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2686 static PyObject *__pyx_n_s_pyx_vtable;
2687 static PyObject *__pyx_n_s_range;
2688 static PyObject *__pyx_n_s_reduce;
2689 static PyObject *__pyx_n_s_reduce_cython;
2690 static PyObject *__pyx_n_s_reduce_ex;
2691 static PyObject *__pyx_n_s_scipy_sparse;
2692 static PyObject *__pyx_n_s_self;
2693 static PyObject *__pyx_n_s_set_csc_matrix_double;
2694 static PyObject *__pyx_n_s_set_csc_matrix_float;
2695 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2696 static PyObject *__pyx_n_s_set_csr_matrix_double;
2697 static PyObject *__pyx_n_s_set_csr_matrix_float;
2698 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2699 static PyObject *__pyx_n_s_set_dense_matrix_double;
2700 static PyObject *__pyx_n_s_set_dense_matrix_float;
2701 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2702 static PyObject *__pyx_n_s_setstate;
2703 static PyObject *__pyx_n_s_setstate_cython;
2704 static PyObject *__pyx_n_s_shape;
2705 static PyObject *__pyx_n_s_size;
2706 static PyObject *__pyx_n_s_sort_indices;
2707 static PyObject *__pyx_n_s_start;
2708 static PyObject *__pyx_n_s_step;
2709 static PyObject *__pyx_n_s_stop;
2710 static PyObject *__pyx_kp_s_strided_and_direct;
2711 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2712 static PyObject *__pyx_kp_s_strided_and_indirect;
2713 static PyObject *__pyx_kp_s_stringsource;
2714 static PyObject *__pyx_n_s_struct;
2715 static PyObject *__pyx_n_s_test;
2716 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2717 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2718 static PyObject *__pyx_n_s_unpack;
2719 static PyObject *__pyx_n_s_update;
2720 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B); /* proto */
2721 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2722 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2723 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2724 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2725 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2726 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2727 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2728 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2729 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity); /* proto */
2730 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self); /* proto */
2731 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2732 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2733 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2734 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2735 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2736 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2737 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2738 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2739 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2740 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2741 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2742 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2743 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2744 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2745 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2746 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2747 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2748 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2749 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2750 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2751 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2752 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2753 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2754 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2755 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2756 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2757 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2758 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2759 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2760 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2761 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2762 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2763 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2764 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2765 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2766 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2767 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2768 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2769 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2770 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2771 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2772 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2773 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2774 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2775 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2776 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2777 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2778 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2779 static PyObject *__pyx_int_0;
2780 static PyObject *__pyx_int_1;
2781 static PyObject *__pyx_int_2;
2782 static PyObject *__pyx_int_184977713;
2783 static PyObject *__pyx_int_neg_1;
2784 static PyObject *__pyx_tuple_;
2785 static PyObject *__pyx_tuple__2;
2786 static PyObject *__pyx_tuple__3;
2787 static PyObject *__pyx_tuple__4;
2788 static PyObject *__pyx_tuple__5;
2789 static PyObject *__pyx_tuple__6;
2790 static PyObject *__pyx_tuple__8;
2791 static PyObject *__pyx_tuple__9;
2792 static PyObject *__pyx_slice__36;
2793 static PyObject *__pyx_tuple__19;
2794 static PyObject *__pyx_tuple__21;
2795 static PyObject *__pyx_tuple__22;
2796 static PyObject *__pyx_tuple__23;
2797 static PyObject *__pyx_tuple__24;
2798 static PyObject *__pyx_tuple__25;
2799 static PyObject *__pyx_tuple__26;
2800 static PyObject *__pyx_tuple__27;
2801 static PyObject *__pyx_tuple__28;
2802 static PyObject *__pyx_tuple__29;
2803 static PyObject *__pyx_tuple__30;
2804 static PyObject *__pyx_tuple__31;
2805 static PyObject *__pyx_tuple__32;
2806 static PyObject *__pyx_tuple__33;
2807 static PyObject *__pyx_tuple__34;
2808 static PyObject *__pyx_tuple__35;
2809 static PyObject *__pyx_tuple__37;
2810 static PyObject *__pyx_tuple__38;
2811 static PyObject *__pyx_tuple__39;
2812 static PyObject *__pyx_tuple__41;
2813 static PyObject *__pyx_tuple__42;
2814 static PyObject *__pyx_tuple__43;
2815 static PyObject *__pyx_tuple__44;
2816 static PyObject *__pyx_tuple__45;
2817 static PyObject *__pyx_tuple__46;
2818 static PyObject *__pyx_tuple__47;
2819 static PyObject *__pyx_tuple__48;
2820 static PyObject *__pyx_tuple__49;
2821 static PyObject *__pyx_tuple__50;
2822 static PyObject *__pyx_tuple__51;
2823 static PyObject *__pyx_tuple__52;
2824 static PyObject *__pyx_tuple__53;
2825 static PyObject *__pyx_tuple__54;
2826 static PyObject *__pyx_tuple__55;
2827 static PyObject *__pyx_tuple__56;
2828 static PyObject *__pyx_tuple__57;
2829 static PyObject *__pyx_codeobj__7;
2830 static PyObject *__pyx_codeobj__10;
2831 static PyObject *__pyx_codeobj__11;
2832 static PyObject *__pyx_codeobj__12;
2833 static PyObject *__pyx_codeobj__13;
2834 static PyObject *__pyx_codeobj__14;
2835 static PyObject *__pyx_codeobj__15;
2836 static PyObject *__pyx_codeobj__16;
2837 static PyObject *__pyx_codeobj__17;
2838 static PyObject *__pyx_codeobj__18;
2839 static PyObject *__pyx_codeobj__20;
2840 static PyObject *__pyx_codeobj__40;
2841 /* Late includes */
2842 
2843 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":172
2844  * # =========
2845  *
2846  * def __cinit__(self, A, B=None): # <<<<<<<<<<<<<<
2847  * """
2848  * Sets matrices A and B.
2849  */
2850 
2851 /* Python wrapper */
2852 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2853 static int __pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2854  PyObject *__pyx_v_A = 0;
2855  PyObject *__pyx_v_B = 0;
2856  int __pyx_lineno = 0;
2857  const char *__pyx_filename = NULL;
2858  int __pyx_clineno = 0;
2859  int __pyx_r;
2860  __Pyx_RefNannyDeclarations
2861  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2862  {
2863  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,0};
2864  PyObject* values[2] = {0,0};
2865  values[1] = ((PyObject *)Py_None);
2866  if (unlikely(__pyx_kwds)) {
2867  Py_ssize_t kw_args;
2868  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2869  switch (pos_args) {
2870  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2871  CYTHON_FALLTHROUGH;
2872  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2873  CYTHON_FALLTHROUGH;
2874  case 0: break;
2875  default: goto __pyx_L5_argtuple_error;
2876  }
2877  kw_args = PyDict_Size(__pyx_kwds);
2878  switch (pos_args) {
2879  case 0:
2880  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
2881  else goto __pyx_L5_argtuple_error;
2882  CYTHON_FALLTHROUGH;
2883  case 1:
2884  if (kw_args > 0) {
2885  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B);
2886  if (value) { values[1] = value; kw_args--; }
2887  }
2888  }
2889  if (unlikely(kw_args > 0)) {
2890  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 172, __pyx_L3_error)
2891  }
2892  } else {
2893  switch (PyTuple_GET_SIZE(__pyx_args)) {
2894  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2895  CYTHON_FALLTHROUGH;
2896  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2897  break;
2898  default: goto __pyx_L5_argtuple_error;
2899  }
2900  }
2901  __pyx_v_A = values[0];
2902  __pyx_v_B = values[1];
2903  }
2904  goto __pyx_L4_argument_unpacking_done;
2905  __pyx_L5_argtuple_error:;
2906  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error)
2907  __pyx_L3_error:;
2908  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2909  __Pyx_RefNannyFinishContext();
2910  return -1;
2911  __pyx_L4_argument_unpacking_done:;
2912  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B);
2913 
2914  /* function exit code */
2915  __Pyx_RefNannyFinishContext();
2916  return __pyx_r;
2917 }
2918 
2919 static int __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B) {
2920  int __pyx_v_B_is_identity;
2921  int __pyx_r;
2922  __Pyx_TraceDeclarations
2923  __Pyx_RefNannyDeclarations
2924  int __pyx_t_1;
2925  int __pyx_t_2;
2926  PyObject *__pyx_t_3 = NULL;
2927  PyObject *__pyx_t_4 = NULL;
2928  PyObject *__pyx_t_5 = NULL;
2929  int __pyx_t_6;
2930  PyObject *__pyx_t_7 = NULL;
2931  int __pyx_t_8;
2932  PyObject *__pyx_t_9 = NULL;
2933  int __pyx_lineno = 0;
2934  const char *__pyx_filename = NULL;
2935  int __pyx_clineno = 0;
2936  __Pyx_RefNannySetupContext("__cinit__", 0);
2937  __Pyx_TraceCall("__cinit__", __pyx_f[0], 172, 0, __PYX_ERR(0, 172, __pyx_L1_error));
2938 
2939  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":178
2940  *
2941  * # Check A
2942  * if A is None: # <<<<<<<<<<<<<<
2943  * raise ValueError('A cannot be None.')
2944  *
2945  */
2946  __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
2947  __pyx_t_1 = (__pyx_v_A == Py_None);
2948  __pyx_t_2 = (__pyx_t_1 != 0);
2949  if (unlikely(__pyx_t_2)) {
2950 
2951  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":179
2952  * # Check A
2953  * if A is None:
2954  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
2955  *
2956  * if A.ndim != 2:
2957  */
2958  __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
2959  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
2960  __Pyx_GOTREF(__pyx_t_3);
2961  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2963  __PYX_ERR(0, 179, __pyx_L1_error)
2964 
2965  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":178
2966  *
2967  * # Check A
2968  * if A is None: # <<<<<<<<<<<<<<
2969  * raise ValueError('A cannot be None.')
2970  *
2971  */
2972  }
2973 
2974  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":181
2975  * raise ValueError('A cannot be None.')
2976  *
2977  * if A.ndim != 2: # <<<<<<<<<<<<<<
2978  * raise ValueError('Input matrix should be a 2-dimensional array.')
2979  *
2980  */
2981  __Pyx_TraceLine(181,0,__PYX_ERR(0, 181, __pyx_L1_error))
2982  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
2983  __Pyx_GOTREF(__pyx_t_3);
2984  __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
2985  __Pyx_GOTREF(__pyx_t_4);
2986  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2987  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
2988  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2989  if (unlikely(__pyx_t_2)) {
2990 
2991  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":182
2992  *
2993  * if A.ndim != 2:
2994  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
2995  *
2996  * # Data type
2997  */
2998  __Pyx_TraceLine(182,0,__PYX_ERR(0, 182, __pyx_L1_error))
2999  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
3000  __Pyx_GOTREF(__pyx_t_4);
3001  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3002  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3003  __PYX_ERR(0, 182, __pyx_L1_error)
3004 
3005  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":181
3006  * raise ValueError('A cannot be None.')
3007  *
3008  * if A.ndim != 2: # <<<<<<<<<<<<<<
3009  * raise ValueError('Input matrix should be a 2-dimensional array.')
3010  *
3011  */
3012  }
3013 
3014  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":185
3015  *
3016  * # Data type
3017  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3018  * self.data_type_name = b'float32'
3019  * elif A.dtype == b'float64':
3020  */
3021  __Pyx_TraceLine(185,0,__PYX_ERR(0, 185, __pyx_L1_error))
3022  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
3023  __Pyx_GOTREF(__pyx_t_4);
3024  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
3025  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3026  if (__pyx_t_2) {
3027 
3028  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":186
3029  * # Data type
3030  * if A.dtype == b'float32':
3031  * self.data_type_name = b'float32' # <<<<<<<<<<<<<<
3032  * elif A.dtype == b'float64':
3033  * self.data_type_name = b'float64'
3034  */
3035  __Pyx_TraceLine(186,0,__PYX_ERR(0, 186, __pyx_L1_error))
3036  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float32");
3037 
3038  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":185
3039  *
3040  * # Data type
3041  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3042  * self.data_type_name = b'float32'
3043  * elif A.dtype == b'float64':
3044  */
3045  goto __pyx_L5;
3046  }
3047 
3048  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":187
3049  * if A.dtype == b'float32':
3050  * self.data_type_name = b'float32'
3051  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3052  * self.data_type_name = b'float64'
3053  * elif A.dtype == b'float128':
3054  */
3055  __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3056  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3057  __Pyx_GOTREF(__pyx_t_4);
3058  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3059  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3060  if (__pyx_t_2) {
3061 
3062  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":188
3063  * self.data_type_name = b'float32'
3064  * elif A.dtype == b'float64':
3065  * self.data_type_name = b'float64' # <<<<<<<<<<<<<<
3066  * elif A.dtype == b'float128':
3067  * self.data_type_name = b'float128'
3068  */
3069  __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3070  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float64");
3071 
3072  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":187
3073  * if A.dtype == b'float32':
3074  * self.data_type_name = b'float32'
3075  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3076  * self.data_type_name = b'float64'
3077  * elif A.dtype == b'float128':
3078  */
3079  goto __pyx_L5;
3080  }
3081 
3082  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":189
3083  * elif A.dtype == b'float64':
3084  * self.data_type_name = b'float64'
3085  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3086  * self.data_type_name = b'float128'
3087  * else:
3088  */
3089  __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error))
3090  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
3091  __Pyx_GOTREF(__pyx_t_4);
3092  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
3093  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3094  if (likely(__pyx_t_2)) {
3095 
3096  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":190
3097  * self.data_type_name = b'float64'
3098  * elif A.dtype == b'float128':
3099  * self.data_type_name = b'float128' # <<<<<<<<<<<<<<
3100  * else:
3101  * raise TypeError('Data type should be float32, float64, or ' +
3102  */
3103  __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error))
3104  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float128");
3105 
3106  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":189
3107  * elif A.dtype == b'float64':
3108  * self.data_type_name = b'float64'
3109  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3110  * self.data_type_name = b'float128'
3111  * else:
3112  */
3113  goto __pyx_L5;
3114  }
3115 
3116  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":192
3117  * self.data_type_name = b'float128'
3118  * else:
3119  * raise TypeError('Data type should be float32, float64, or ' + # <<<<<<<<<<<<<<
3120  * 'float128.')
3121  *
3122  */
3123  __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3124  /*else*/ {
3125  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3126  __Pyx_GOTREF(__pyx_t_4);
3127  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3128  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3129  __PYX_ERR(0, 192, __pyx_L1_error)
3130  }
3131  __pyx_L5:;
3132 
3133  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":196
3134  *
3135  * # Check if B is noe to be considered as identity matrix
3136  * if B is None: # <<<<<<<<<<<<<<
3137  *
3138  * # B is assumed to be identity
3139  */
3140  __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error))
3141  __pyx_t_2 = (__pyx_v_B == Py_None);
3142  __pyx_t_1 = (__pyx_t_2 != 0);
3143  if (__pyx_t_1) {
3144 
3145  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":199
3146  *
3147  * # B is assumed to be identity
3148  * B_is_identity = True # <<<<<<<<<<<<<<
3149  *
3150  * else:
3151  */
3152  __Pyx_TraceLine(199,0,__PYX_ERR(0, 199, __pyx_L1_error))
3153  __pyx_v_B_is_identity = 1;
3154 
3155  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":196
3156  *
3157  * # Check if B is noe to be considered as identity matrix
3158  * if B is None: # <<<<<<<<<<<<<<
3159  *
3160  * # B is assumed to be identity
3161  */
3162  goto __pyx_L6;
3163  }
3164 
3165  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":204
3166  *
3167  * # B is neither zero nor identity
3168  * B_is_identity = False # <<<<<<<<<<<<<<
3169  *
3170  * # Check similar types of A and B
3171  */
3172  __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
3173  /*else*/ {
3174  __pyx_v_B_is_identity = 0;
3175 
3176  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":207
3177  *
3178  * # Check similar types of A and B
3179  * if not (type(A) == type(B)): # <<<<<<<<<<<<<<
3180  * raise TypeError('Matrices A and B should have similar types.')
3181  *
3182  */
3183  __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
3184  __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_A)), ((PyObject *)Py_TYPE(__pyx_v_B)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
3185  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 207, __pyx_L1_error)
3186  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3187  __pyx_t_2 = ((!__pyx_t_1) != 0);
3188  if (unlikely(__pyx_t_2)) {
3189 
3190  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":208
3191  * # Check similar types of A and B
3192  * if not (type(A) == type(B)):
3193  * raise TypeError('Matrices A and B should have similar types.') # <<<<<<<<<<<<<<
3194  *
3195  * # Check A and B have the same data types
3196  */
3197  __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error))
3198  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
3199  __Pyx_GOTREF(__pyx_t_4);
3200  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3201  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3202  __PYX_ERR(0, 208, __pyx_L1_error)
3203 
3204  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":207
3205  *
3206  * # Check similar types of A and B
3207  * if not (type(A) == type(B)): # <<<<<<<<<<<<<<
3208  * raise TypeError('Matrices A and B should have similar types.')
3209  *
3210  */
3211  }
3212 
3213  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":211
3214  *
3215  * # Check A and B have the same data types
3216  * if not (A.dtype == B.dtype): # <<<<<<<<<<<<<<
3217  * raise TypeError('A and B should have similar data types.')
3218  *
3219  */
3220  __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
3221  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
3222  __Pyx_GOTREF(__pyx_t_4);
3223  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
3224  __Pyx_GOTREF(__pyx_t_3);
3225  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
3226  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3227  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3228  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
3229  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3230  __pyx_t_1 = ((!__pyx_t_2) != 0);
3231  if (unlikely(__pyx_t_1)) {
3232 
3233  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":212
3234  * # Check A and B have the same data types
3235  * if not (A.dtype == B.dtype):
3236  * raise TypeError('A and B should have similar data types.') # <<<<<<<<<<<<<<
3237  *
3238  * # Check consistent sizes of A and B
3239  */
3240  __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
3241  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
3242  __Pyx_GOTREF(__pyx_t_5);
3243  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
3244  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3245  __PYX_ERR(0, 212, __pyx_L1_error)
3246 
3247  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":211
3248  *
3249  * # Check A and B have the same data types
3250  * if not (A.dtype == B.dtype): # <<<<<<<<<<<<<<
3251  * raise TypeError('A and B should have similar data types.')
3252  *
3253  */
3254  }
3255 
3256  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":215
3257  *
3258  * # Check consistent sizes of A and B
3259  * if not (A.shape == B.shape): # <<<<<<<<<<<<<<
3260  * raise ValueError('A and B should have the same shape.')
3261  *
3262  */
3263  __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
3264  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
3265  __Pyx_GOTREF(__pyx_t_5);
3266  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
3267  __Pyx_GOTREF(__pyx_t_3);
3268  __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
3269  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3270  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3271  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
3272  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3273  __pyx_t_2 = ((!__pyx_t_1) != 0);
3274  if (unlikely(__pyx_t_2)) {
3275 
3276  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":216
3277  * # Check consistent sizes of A and B
3278  * if not (A.shape == B.shape):
3279  * raise ValueError('A and B should have the same shape.') # <<<<<<<<<<<<<<
3280  *
3281  * # Determine A is sparse or dense
3282  */
3283  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
3284  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
3285  __Pyx_GOTREF(__pyx_t_4);
3286  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3287  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3288  __PYX_ERR(0, 216, __pyx_L1_error)
3289 
3290  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":215
3291  *
3292  * # Check consistent sizes of A and B
3293  * if not (A.shape == B.shape): # <<<<<<<<<<<<<<
3294  * raise ValueError('A and B should have the same shape.')
3295  *
3296  */
3297  }
3298  }
3299  __pyx_L6:;
3300 
3301  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":219
3302  *
3303  * # Determine A is sparse or dense
3304  * if issparse(A): # <<<<<<<<<<<<<<
3305  *
3306  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3307  */
3308  __Pyx_TraceLine(219,0,__PYX_ERR(0, 219, __pyx_L1_error))
3309  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
3310  __Pyx_GOTREF(__pyx_t_3);
3311  __pyx_t_5 = NULL;
3312  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3313  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3314  if (likely(__pyx_t_5)) {
3315  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3316  __Pyx_INCREF(__pyx_t_5);
3317  __Pyx_INCREF(function);
3318  __Pyx_DECREF_SET(__pyx_t_3, function);
3319  }
3320  }
3321  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3322  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3323  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
3324  __Pyx_GOTREF(__pyx_t_4);
3325  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3326  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
3327  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3328  if (__pyx_t_2) {
3329 
3330  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":222
3331  *
3332  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3333  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3334  *
3335  * # Check sorted indices
3336  */
3337  __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
3338  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
3339  __Pyx_GOTREF(__pyx_t_3);
3340  __pyx_t_5 = NULL;
3341  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3342  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3343  if (likely(__pyx_t_5)) {
3344  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3345  __Pyx_INCREF(__pyx_t_5);
3346  __Pyx_INCREF(function);
3347  __Pyx_DECREF_SET(__pyx_t_3, function);
3348  }
3349  }
3350  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3351  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3352  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
3353  __Pyx_GOTREF(__pyx_t_4);
3354  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3355  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
3356  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3357  if (__pyx_t_2) {
3358 
3359  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":225
3360  *
3361  * # Check sorted indices
3362  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3363  * A.sort_indices()
3364  *
3365  */
3366  __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
3367  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
3368  __Pyx_GOTREF(__pyx_t_4);
3369  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 225, __pyx_L1_error)
3370  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3371  __pyx_t_1 = ((!__pyx_t_2) != 0);
3372  if (__pyx_t_1) {
3373 
3374  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":226
3375  * # Check sorted indices
3376  * if not A.has_sorted_indices:
3377  * A.sort_indices() # <<<<<<<<<<<<<<
3378  *
3379  * if (not B_is_identity) and (not B.has_sorted_indices):
3380  */
3381  __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
3382  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error)
3383  __Pyx_GOTREF(__pyx_t_3);
3384  __pyx_t_5 = NULL;
3385  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3386  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3387  if (likely(__pyx_t_5)) {
3388  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3389  __Pyx_INCREF(__pyx_t_5);
3390  __Pyx_INCREF(function);
3391  __Pyx_DECREF_SET(__pyx_t_3, function);
3392  }
3393  }
3394  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3395  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3396  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
3397  __Pyx_GOTREF(__pyx_t_4);
3398  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3399  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3400 
3401  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":225
3402  *
3403  * # Check sorted indices
3404  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3405  * A.sort_indices()
3406  *
3407  */
3408  }
3409 
3410  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":228
3411  * A.sort_indices()
3412  *
3413  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
3414  * B.sort_indices()
3415  *
3416  */
3417  __Pyx_TraceLine(228,0,__PYX_ERR(0, 228, __pyx_L1_error))
3418  __pyx_t_2 = ((!(__pyx_v_B_is_identity != 0)) != 0);
3419  if (__pyx_t_2) {
3420  } else {
3421  __pyx_t_1 = __pyx_t_2;
3422  goto __pyx_L14_bool_binop_done;
3423  }
3424  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
3425  __Pyx_GOTREF(__pyx_t_4);
3426  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
3427  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3428  __pyx_t_6 = ((!__pyx_t_2) != 0);
3429  __pyx_t_1 = __pyx_t_6;
3430  __pyx_L14_bool_binop_done:;
3431  if (__pyx_t_1) {
3432 
3433  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":229
3434  *
3435  * if (not B_is_identity) and (not B.has_sorted_indices):
3436  * B.sort_indices() # <<<<<<<<<<<<<<
3437  *
3438  * # CSR matrix
3439  */
3440  __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error))
3441  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
3442  __Pyx_GOTREF(__pyx_t_3);
3443  __pyx_t_5 = NULL;
3444  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3445  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3446  if (likely(__pyx_t_5)) {
3447  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3448  __Pyx_INCREF(__pyx_t_5);
3449  __Pyx_INCREF(function);
3450  __Pyx_DECREF_SET(__pyx_t_3, function);
3451  }
3452  }
3453  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3454  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3455  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
3456  __Pyx_GOTREF(__pyx_t_4);
3457  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3458  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3459 
3460  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":228
3461  * A.sort_indices()
3462  *
3463  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
3464  * B.sort_indices()
3465  *
3466  */
3467  }
3468 
3469  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":232
3470  *
3471  * # CSR matrix
3472  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3473  * self.set_csr_matrix_float(A, B, B_is_identity)
3474  *
3475  */
3476  __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
3477  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
3478  __Pyx_GOTREF(__pyx_t_4);
3479  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
3480  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3481  if (__pyx_t_1) {
3482 
3483  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":233
3484  * # CSR matrix
3485  * if self.data_type_name == b'float32':
3486  * self.set_csr_matrix_float(A, B, B_is_identity) # <<<<<<<<<<<<<<
3487  *
3488  * elif self.data_type_name == b'float64':
3489  */
3490  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
3491  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
3492  __Pyx_GOTREF(__pyx_t_3);
3493  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
3494  __Pyx_GOTREF(__pyx_t_5);
3495  __pyx_t_7 = NULL;
3496  __pyx_t_8 = 0;
3497  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3498  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3499  if (likely(__pyx_t_7)) {
3500  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3501  __Pyx_INCREF(__pyx_t_7);
3502  __Pyx_INCREF(function);
3503  __Pyx_DECREF_SET(__pyx_t_3, function);
3504  __pyx_t_8 = 1;
3505  }
3506  }
3507  #if CYTHON_FAST_PYCALL
3508  if (PyFunction_Check(__pyx_t_3)) {
3509  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3510  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3511  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3512  __Pyx_GOTREF(__pyx_t_4);
3513  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3514  } else
3515  #endif
3516  #if CYTHON_FAST_PYCCALL
3517  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3518  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3519  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3520  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3521  __Pyx_GOTREF(__pyx_t_4);
3522  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3523  } else
3524  #endif
3525  {
3526  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error)
3527  __Pyx_GOTREF(__pyx_t_9);
3528  if (__pyx_t_7) {
3529  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
3530  }
3531  __Pyx_INCREF(__pyx_v_A);
3532  __Pyx_GIVEREF(__pyx_v_A);
3533  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
3534  __Pyx_INCREF(__pyx_v_B);
3535  __Pyx_GIVEREF(__pyx_v_B);
3536  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
3537  __Pyx_GIVEREF(__pyx_t_5);
3538  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
3539  __pyx_t_5 = 0;
3540  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
3541  __Pyx_GOTREF(__pyx_t_4);
3542  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3543  }
3544  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3545  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3546 
3547  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":232
3548  *
3549  * # CSR matrix
3550  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3551  * self.set_csr_matrix_float(A, B, B_is_identity)
3552  *
3553  */
3554  goto __pyx_L16;
3555  }
3556 
3557  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":235
3558  * self.set_csr_matrix_float(A, B, B_is_identity)
3559  *
3560  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3561  * self.set_csr_matrix_double(A, B, B_is_identity)
3562  *
3563  */
3564  __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
3565  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
3566  __Pyx_GOTREF(__pyx_t_4);
3567  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
3568  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3569  if (__pyx_t_1) {
3570 
3571  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":236
3572  *
3573  * elif self.data_type_name == b'float64':
3574  * self.set_csr_matrix_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
3575  *
3576  * elif self.data_type_name == b'float128':
3577  */
3578  __Pyx_TraceLine(236,0,__PYX_ERR(0, 236, __pyx_L1_error))
3579  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
3580  __Pyx_GOTREF(__pyx_t_3);
3581  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error)
3582  __Pyx_GOTREF(__pyx_t_9);
3583  __pyx_t_5 = NULL;
3584  __pyx_t_8 = 0;
3585  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3586  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3587  if (likely(__pyx_t_5)) {
3588  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3589  __Pyx_INCREF(__pyx_t_5);
3590  __Pyx_INCREF(function);
3591  __Pyx_DECREF_SET(__pyx_t_3, function);
3592  __pyx_t_8 = 1;
3593  }
3594  }
3595  #if CYTHON_FAST_PYCALL
3596  if (PyFunction_Check(__pyx_t_3)) {
3597  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3598  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3599  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3600  __Pyx_GOTREF(__pyx_t_4);
3601  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3602  } else
3603  #endif
3604  #if CYTHON_FAST_PYCCALL
3605  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3606  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
3607  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3608  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3609  __Pyx_GOTREF(__pyx_t_4);
3610  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3611  } else
3612  #endif
3613  {
3614  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
3615  __Pyx_GOTREF(__pyx_t_7);
3616  if (__pyx_t_5) {
3617  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
3618  }
3619  __Pyx_INCREF(__pyx_v_A);
3620  __Pyx_GIVEREF(__pyx_v_A);
3621  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
3622  __Pyx_INCREF(__pyx_v_B);
3623  __Pyx_GIVEREF(__pyx_v_B);
3624  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
3625  __Pyx_GIVEREF(__pyx_t_9);
3626  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
3627  __pyx_t_9 = 0;
3628  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
3629  __Pyx_GOTREF(__pyx_t_4);
3630  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3631  }
3632  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3633  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3634 
3635  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":235
3636  * self.set_csr_matrix_float(A, B, B_is_identity)
3637  *
3638  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3639  * self.set_csr_matrix_double(A, B, B_is_identity)
3640  *
3641  */
3642  goto __pyx_L16;
3643  }
3644 
3645  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":238
3646  * self.set_csr_matrix_double(A, B, B_is_identity)
3647  *
3648  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3649  * self.set_csr_matrix_long_double(A, B, B_is_identity)
3650  *
3651  */
3652  __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error))
3653  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
3654  __Pyx_GOTREF(__pyx_t_4);
3655  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
3656  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3657  if (__pyx_t_1) {
3658 
3659  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":239
3660  *
3661  * elif self.data_type_name == b'float128':
3662  * self.set_csr_matrix_long_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
3663  *
3664  * elif isspmatrix_csc(A):
3665  */
3666  __Pyx_TraceLine(239,0,__PYX_ERR(0, 239, __pyx_L1_error))
3667  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
3668  __Pyx_GOTREF(__pyx_t_3);
3669  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error)
3670  __Pyx_GOTREF(__pyx_t_7);
3671  __pyx_t_9 = NULL;
3672  __pyx_t_8 = 0;
3673  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3674  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
3675  if (likely(__pyx_t_9)) {
3676  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3677  __Pyx_INCREF(__pyx_t_9);
3678  __Pyx_INCREF(function);
3679  __Pyx_DECREF_SET(__pyx_t_3, function);
3680  __pyx_t_8 = 1;
3681  }
3682  }
3683  #if CYTHON_FAST_PYCALL
3684  if (PyFunction_Check(__pyx_t_3)) {
3685  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3686  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3687  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3688  __Pyx_GOTREF(__pyx_t_4);
3689  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3690  } else
3691  #endif
3692  #if CYTHON_FAST_PYCCALL
3693  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3694  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
3695  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3696  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3697  __Pyx_GOTREF(__pyx_t_4);
3698  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3699  } else
3700  #endif
3701  {
3702  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error)
3703  __Pyx_GOTREF(__pyx_t_5);
3704  if (__pyx_t_9) {
3705  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
3706  }
3707  __Pyx_INCREF(__pyx_v_A);
3708  __Pyx_GIVEREF(__pyx_v_A);
3709  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
3710  __Pyx_INCREF(__pyx_v_B);
3711  __Pyx_GIVEREF(__pyx_v_B);
3712  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
3713  __Pyx_GIVEREF(__pyx_t_7);
3714  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
3715  __pyx_t_7 = 0;
3716  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
3717  __Pyx_GOTREF(__pyx_t_4);
3718  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3719  }
3720  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3721  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3722 
3723  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":238
3724  * self.set_csr_matrix_double(A, B, B_is_identity)
3725  *
3726  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3727  * self.set_csr_matrix_long_double(A, B, B_is_identity)
3728  *
3729  */
3730  }
3731  __pyx_L16:;
3732 
3733  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":222
3734  *
3735  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3736  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3737  *
3738  * # Check sorted indices
3739  */
3740  goto __pyx_L11;
3741  }
3742 
3743  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":241
3744  * self.set_csr_matrix_long_double(A, B, B_is_identity)
3745  *
3746  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3747  *
3748  * # Check sorted indices
3749  */
3750  __Pyx_TraceLine(241,0,__PYX_ERR(0, 241, __pyx_L1_error))
3751  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
3752  __Pyx_GOTREF(__pyx_t_3);
3753  __pyx_t_5 = NULL;
3754  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3755  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3756  if (likely(__pyx_t_5)) {
3757  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3758  __Pyx_INCREF(__pyx_t_5);
3759  __Pyx_INCREF(function);
3760  __Pyx_DECREF_SET(__pyx_t_3, function);
3761  }
3762  }
3763  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3764  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3765  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
3766  __Pyx_GOTREF(__pyx_t_4);
3767  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3768  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
3769  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3770  if (__pyx_t_1) {
3771 
3772  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":244
3773  *
3774  * # Check sorted indices
3775  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3776  * A.sort_indices()
3777  *
3778  */
3779  __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error))
3780  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
3781  __Pyx_GOTREF(__pyx_t_4);
3782  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
3783  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3784  __pyx_t_6 = ((!__pyx_t_1) != 0);
3785  if (__pyx_t_6) {
3786 
3787  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":245
3788  * # Check sorted indices
3789  * if not A.has_sorted_indices:
3790  * A.sort_indices() # <<<<<<<<<<<<<<
3791  *
3792  * if (not B_is_identity) and (not B.has_sorted_indices):
3793  */
3794  __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
3795  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
3796  __Pyx_GOTREF(__pyx_t_3);
3797  __pyx_t_5 = NULL;
3798  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3799  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3800  if (likely(__pyx_t_5)) {
3801  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3802  __Pyx_INCREF(__pyx_t_5);
3803  __Pyx_INCREF(function);
3804  __Pyx_DECREF_SET(__pyx_t_3, function);
3805  }
3806  }
3807  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3808  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3809  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
3810  __Pyx_GOTREF(__pyx_t_4);
3811  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3812  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3813 
3814  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":244
3815  *
3816  * # Check sorted indices
3817  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3818  * A.sort_indices()
3819  *
3820  */
3821  }
3822 
3823  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":247
3824  * A.sort_indices()
3825  *
3826  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
3827  * B.sort_indices()
3828  *
3829  */
3830  __Pyx_TraceLine(247,0,__PYX_ERR(0, 247, __pyx_L1_error))
3831  __pyx_t_1 = ((!(__pyx_v_B_is_identity != 0)) != 0);
3832  if (__pyx_t_1) {
3833  } else {
3834  __pyx_t_6 = __pyx_t_1;
3835  goto __pyx_L19_bool_binop_done;
3836  }
3837  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
3838  __Pyx_GOTREF(__pyx_t_4);
3839  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 247, __pyx_L1_error)
3840  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3841  __pyx_t_2 = ((!__pyx_t_1) != 0);
3842  __pyx_t_6 = __pyx_t_2;
3843  __pyx_L19_bool_binop_done:;
3844  if (__pyx_t_6) {
3845 
3846  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":248
3847  *
3848  * if (not B_is_identity) and (not B.has_sorted_indices):
3849  * B.sort_indices() # <<<<<<<<<<<<<<
3850  *
3851  * # CSC matrix
3852  */
3853  __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
3854  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
3855  __Pyx_GOTREF(__pyx_t_3);
3856  __pyx_t_5 = NULL;
3857  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3858  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3859  if (likely(__pyx_t_5)) {
3860  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3861  __Pyx_INCREF(__pyx_t_5);
3862  __Pyx_INCREF(function);
3863  __Pyx_DECREF_SET(__pyx_t_3, function);
3864  }
3865  }
3866  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3867  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3868  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
3869  __Pyx_GOTREF(__pyx_t_4);
3870  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3871  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3872 
3873  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":247
3874  * A.sort_indices()
3875  *
3876  * if (not B_is_identity) and (not B.has_sorted_indices): # <<<<<<<<<<<<<<
3877  * B.sort_indices()
3878  *
3879  */
3880  }
3881 
3882  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":251
3883  *
3884  * # CSC matrix
3885  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3886  * self.set_csc_matrix_float(A, B, B_is_identity)
3887  *
3888  */
3889  __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
3890  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
3891  __Pyx_GOTREF(__pyx_t_4);
3892  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
3893  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3894  if (__pyx_t_6) {
3895 
3896  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":252
3897  * # CSC matrix
3898  * if self.data_type_name == b'float32':
3899  * self.set_csc_matrix_float(A, B, B_is_identity) # <<<<<<<<<<<<<<
3900  *
3901  * elif self.data_type_name == b'float64':
3902  */
3903  __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error))
3904  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
3905  __Pyx_GOTREF(__pyx_t_3);
3906  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
3907  __Pyx_GOTREF(__pyx_t_5);
3908  __pyx_t_7 = NULL;
3909  __pyx_t_8 = 0;
3910  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3911  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3912  if (likely(__pyx_t_7)) {
3913  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3914  __Pyx_INCREF(__pyx_t_7);
3915  __Pyx_INCREF(function);
3916  __Pyx_DECREF_SET(__pyx_t_3, function);
3917  __pyx_t_8 = 1;
3918  }
3919  }
3920  #if CYTHON_FAST_PYCALL
3921  if (PyFunction_Check(__pyx_t_3)) {
3922  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3923  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
3924  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3925  __Pyx_GOTREF(__pyx_t_4);
3926  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3927  } else
3928  #endif
3929  #if CYTHON_FAST_PYCCALL
3930  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3931  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
3932  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
3933  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3934  __Pyx_GOTREF(__pyx_t_4);
3935  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3936  } else
3937  #endif
3938  {
3939  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error)
3940  __Pyx_GOTREF(__pyx_t_9);
3941  if (__pyx_t_7) {
3942  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
3943  }
3944  __Pyx_INCREF(__pyx_v_A);
3945  __Pyx_GIVEREF(__pyx_v_A);
3946  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
3947  __Pyx_INCREF(__pyx_v_B);
3948  __Pyx_GIVEREF(__pyx_v_B);
3949  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
3950  __Pyx_GIVEREF(__pyx_t_5);
3951  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
3952  __pyx_t_5 = 0;
3953  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
3954  __Pyx_GOTREF(__pyx_t_4);
3955  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3956  }
3957  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3958  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3959 
3960  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":251
3961  *
3962  * # CSC matrix
3963  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3964  * self.set_csc_matrix_float(A, B, B_is_identity)
3965  *
3966  */
3967  goto __pyx_L21;
3968  }
3969 
3970  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":254
3971  * self.set_csc_matrix_float(A, B, B_is_identity)
3972  *
3973  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3974  * self.set_csc_matrix_double(A, B, B_is_identity)
3975  *
3976  */
3977  __Pyx_TraceLine(254,0,__PYX_ERR(0, 254, __pyx_L1_error))
3978  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
3979  __Pyx_GOTREF(__pyx_t_4);
3980  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 254, __pyx_L1_error)
3981  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3982  if (__pyx_t_6) {
3983 
3984  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":255
3985  *
3986  * elif self.data_type_name == b'float64':
3987  * self.set_csc_matrix_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
3988  *
3989  * elif self.data_type_name == b'float128':
3990  */
3991  __Pyx_TraceLine(255,0,__PYX_ERR(0, 255, __pyx_L1_error))
3992  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
3993  __Pyx_GOTREF(__pyx_t_3);
3994  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 255, __pyx_L1_error)
3995  __Pyx_GOTREF(__pyx_t_9);
3996  __pyx_t_5 = NULL;
3997  __pyx_t_8 = 0;
3998  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3999  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4000  if (likely(__pyx_t_5)) {
4001  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4002  __Pyx_INCREF(__pyx_t_5);
4003  __Pyx_INCREF(function);
4004  __Pyx_DECREF_SET(__pyx_t_3, function);
4005  __pyx_t_8 = 1;
4006  }
4007  }
4008  #if CYTHON_FAST_PYCALL
4009  if (PyFunction_Check(__pyx_t_3)) {
4010  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4011  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4012  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4013  __Pyx_GOTREF(__pyx_t_4);
4014  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4015  } else
4016  #endif
4017  #if CYTHON_FAST_PYCCALL
4018  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4019  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4020  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4021  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4022  __Pyx_GOTREF(__pyx_t_4);
4023  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4024  } else
4025  #endif
4026  {
4027  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
4028  __Pyx_GOTREF(__pyx_t_7);
4029  if (__pyx_t_5) {
4030  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4031  }
4032  __Pyx_INCREF(__pyx_v_A);
4033  __Pyx_GIVEREF(__pyx_v_A);
4034  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
4035  __Pyx_INCREF(__pyx_v_B);
4036  __Pyx_GIVEREF(__pyx_v_B);
4037  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
4038  __Pyx_GIVEREF(__pyx_t_9);
4039  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4040  __pyx_t_9 = 0;
4041  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
4042  __Pyx_GOTREF(__pyx_t_4);
4043  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4044  }
4045  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4046  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4047 
4048  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":254
4049  * self.set_csc_matrix_float(A, B, B_is_identity)
4050  *
4051  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4052  * self.set_csc_matrix_double(A, B, B_is_identity)
4053  *
4054  */
4055  goto __pyx_L21;
4056  }
4057 
4058  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":257
4059  * self.set_csc_matrix_double(A, B, B_is_identity)
4060  *
4061  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4062  * self.set_csc_matrix_long_double(A, B, B_is_identity)
4063  *
4064  */
4065  __Pyx_TraceLine(257,0,__PYX_ERR(0, 257, __pyx_L1_error))
4066  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
4067  __Pyx_GOTREF(__pyx_t_4);
4068  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
4069  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4070  if (__pyx_t_6) {
4071 
4072  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":258
4073  *
4074  * elif self.data_type_name == b'float128':
4075  * self.set_csc_matrix_long_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
4076  *
4077  * else:
4078  */
4079  __Pyx_TraceLine(258,0,__PYX_ERR(0, 258, __pyx_L1_error))
4080  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
4081  __Pyx_GOTREF(__pyx_t_3);
4082  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
4083  __Pyx_GOTREF(__pyx_t_7);
4084  __pyx_t_9 = NULL;
4085  __pyx_t_8 = 0;
4086  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4087  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4088  if (likely(__pyx_t_9)) {
4089  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4090  __Pyx_INCREF(__pyx_t_9);
4091  __Pyx_INCREF(function);
4092  __Pyx_DECREF_SET(__pyx_t_3, function);
4093  __pyx_t_8 = 1;
4094  }
4095  }
4096  #if CYTHON_FAST_PYCALL
4097  if (PyFunction_Check(__pyx_t_3)) {
4098  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4099  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4100  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4101  __Pyx_GOTREF(__pyx_t_4);
4102  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4103  } else
4104  #endif
4105  #if CYTHON_FAST_PYCCALL
4106  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4107  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4108  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4109  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4110  __Pyx_GOTREF(__pyx_t_4);
4111  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4112  } else
4113  #endif
4114  {
4115  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
4116  __Pyx_GOTREF(__pyx_t_5);
4117  if (__pyx_t_9) {
4118  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4119  }
4120  __Pyx_INCREF(__pyx_v_A);
4121  __Pyx_GIVEREF(__pyx_v_A);
4122  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
4123  __Pyx_INCREF(__pyx_v_B);
4124  __Pyx_GIVEREF(__pyx_v_B);
4125  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
4126  __Pyx_GIVEREF(__pyx_t_7);
4127  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4128  __pyx_t_7 = 0;
4129  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
4130  __Pyx_GOTREF(__pyx_t_4);
4131  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4132  }
4133  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4134  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4135 
4136  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":257
4137  * self.set_csc_matrix_double(A, B, B_is_identity)
4138  *
4139  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4140  * self.set_csc_matrix_long_double(A, B, B_is_identity)
4141  *
4142  */
4143  }
4144  __pyx_L21:;
4145 
4146  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":241
4147  * self.set_csr_matrix_long_double(A, B, B_is_identity)
4148  *
4149  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
4150  *
4151  * # Check sorted indices
4152  */
4153  goto __pyx_L11;
4154  }
4155 
4156  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":263
4157  *
4158  * # If A is neither CSR or CSC, convert A to CSR
4159  * self.A_csr = csr_matrix(A) # <<<<<<<<<<<<<<
4160  *
4161  * if not B_is_identity:
4162  */
4163  __Pyx_TraceLine(263,0,__PYX_ERR(0, 263, __pyx_L1_error))
4164  /*else*/ {
4165  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
4166  __Pyx_GOTREF(__pyx_t_3);
4167  __pyx_t_5 = NULL;
4168  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4169  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4170  if (likely(__pyx_t_5)) {
4171  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4172  __Pyx_INCREF(__pyx_t_5);
4173  __Pyx_INCREF(function);
4174  __Pyx_DECREF_SET(__pyx_t_3, function);
4175  }
4176  }
4177  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4178  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4179  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
4180  __Pyx_GOTREF(__pyx_t_4);
4181  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4182  __Pyx_GIVEREF(__pyx_t_4);
4183  __Pyx_GOTREF(__pyx_v_self->A_csr);
4184  __Pyx_DECREF(__pyx_v_self->A_csr);
4185  __pyx_v_self->A_csr = __pyx_t_4;
4186  __pyx_t_4 = 0;
4187 
4188  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":265
4189  * self.A_csr = csr_matrix(A)
4190  *
4191  * if not B_is_identity: # <<<<<<<<<<<<<<
4192  * self.B_csr = csr_matrix(B)
4193  * else:
4194  */
4195  __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error))
4196  __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4197  if (__pyx_t_6) {
4198 
4199  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":266
4200  *
4201  * if not B_is_identity:
4202  * self.B_csr = csr_matrix(B) # <<<<<<<<<<<<<<
4203  * else:
4204  * self.B_csr = B
4205  */
4206  __Pyx_TraceLine(266,0,__PYX_ERR(0, 266, __pyx_L1_error))
4207  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
4208  __Pyx_GOTREF(__pyx_t_3);
4209  __pyx_t_5 = NULL;
4210  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4211  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4212  if (likely(__pyx_t_5)) {
4213  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4214  __Pyx_INCREF(__pyx_t_5);
4215  __Pyx_INCREF(function);
4216  __Pyx_DECREF_SET(__pyx_t_3, function);
4217  }
4218  }
4219  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_B) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_B);
4220  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4221  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
4222  __Pyx_GOTREF(__pyx_t_4);
4223  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4224  __Pyx_GIVEREF(__pyx_t_4);
4225  __Pyx_GOTREF(__pyx_v_self->B_csr);
4226  __Pyx_DECREF(__pyx_v_self->B_csr);
4227  __pyx_v_self->B_csr = __pyx_t_4;
4228  __pyx_t_4 = 0;
4229 
4230  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":265
4231  * self.A_csr = csr_matrix(A)
4232  *
4233  * if not B_is_identity: # <<<<<<<<<<<<<<
4234  * self.B_csr = csr_matrix(B)
4235  * else:
4236  */
4237  goto __pyx_L22;
4238  }
4239 
4240  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":268
4241  * self.B_csr = csr_matrix(B)
4242  * else:
4243  * self.B_csr = B # <<<<<<<<<<<<<<
4244  *
4245  * # Check sorted indices
4246  */
4247  __Pyx_TraceLine(268,0,__PYX_ERR(0, 268, __pyx_L1_error))
4248  /*else*/ {
4249  __Pyx_INCREF(__pyx_v_B);
4250  __Pyx_GIVEREF(__pyx_v_B);
4251  __Pyx_GOTREF(__pyx_v_self->B_csr);
4252  __Pyx_DECREF(__pyx_v_self->B_csr);
4253  __pyx_v_self->B_csr = __pyx_v_B;
4254  }
4255  __pyx_L22:;
4256 
4257  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":271
4258  *
4259  * # Check sorted indices
4260  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
4261  * self.A_csr.sort_indices()
4262  *
4263  */
4264  __Pyx_TraceLine(271,0,__PYX_ERR(0, 271, __pyx_L1_error))
4265  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
4266  __Pyx_GOTREF(__pyx_t_4);
4267  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
4268  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4269  __pyx_t_2 = ((!__pyx_t_6) != 0);
4270  if (__pyx_t_2) {
4271 
4272  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":272
4273  * # Check sorted indices
4274  * if not self.A_csr.has_sorted_indices:
4275  * self.A_csr.sort_indices() # <<<<<<<<<<<<<<
4276  *
4277  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices):
4278  */
4279  __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
4280  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
4281  __Pyx_GOTREF(__pyx_t_3);
4282  __pyx_t_5 = NULL;
4283  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4284  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4285  if (likely(__pyx_t_5)) {
4286  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4287  __Pyx_INCREF(__pyx_t_5);
4288  __Pyx_INCREF(function);
4289  __Pyx_DECREF_SET(__pyx_t_3, function);
4290  }
4291  }
4292  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4293  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4294  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
4295  __Pyx_GOTREF(__pyx_t_4);
4296  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4297  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4298 
4299  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":271
4300  *
4301  * # Check sorted indices
4302  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
4303  * self.A_csr.sort_indices()
4304  *
4305  */
4306  }
4307 
4308  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":274
4309  * self.A_csr.sort_indices()
4310  *
4311  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices): # <<<<<<<<<<<<<<
4312  * self.B_csr.sort_indices()
4313  *
4314  */
4315  __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
4316  __pyx_t_6 = ((!(__pyx_v_B_is_identity != 0)) != 0);
4317  if (__pyx_t_6) {
4318  } else {
4319  __pyx_t_2 = __pyx_t_6;
4320  goto __pyx_L25_bool_binop_done;
4321  }
4322  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
4323  __Pyx_GOTREF(__pyx_t_4);
4324  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
4325  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4326  __pyx_t_1 = ((!__pyx_t_6) != 0);
4327  __pyx_t_2 = __pyx_t_1;
4328  __pyx_L25_bool_binop_done:;
4329  if (__pyx_t_2) {
4330 
4331  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":275
4332  *
4333  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices):
4334  * self.B_csr.sort_indices() # <<<<<<<<<<<<<<
4335  *
4336  * # CSR matrix
4337  */
4338  __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error))
4339  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->B_csr, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
4340  __Pyx_GOTREF(__pyx_t_3);
4341  __pyx_t_5 = NULL;
4342  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4343  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4344  if (likely(__pyx_t_5)) {
4345  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4346  __Pyx_INCREF(__pyx_t_5);
4347  __Pyx_INCREF(function);
4348  __Pyx_DECREF_SET(__pyx_t_3, function);
4349  }
4350  }
4351  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4352  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4353  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
4354  __Pyx_GOTREF(__pyx_t_4);
4355  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4356  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4357 
4358  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":274
4359  * self.A_csr.sort_indices()
4360  *
4361  * if (not B_is_identity) and (not self.B_csr.has_sorted_indices): # <<<<<<<<<<<<<<
4362  * self.B_csr.sort_indices()
4363  *
4364  */
4365  }
4366 
4367  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":278
4368  *
4369  * # CSR matrix
4370  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4371  * self.set_csr_matrix_float(self.A_csr, self.B_csr,
4372  * B_is_identity)
4373  */
4374  __Pyx_TraceLine(278,0,__PYX_ERR(0, 278, __pyx_L1_error))
4375  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
4376  __Pyx_GOTREF(__pyx_t_4);
4377  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
4378  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4379  if (__pyx_t_2) {
4380 
4381  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":279
4382  * # CSR matrix
4383  * if self.data_type_name == b'float32':
4384  * self.set_csr_matrix_float(self.A_csr, self.B_csr, # <<<<<<<<<<<<<<
4385  * B_is_identity)
4386  *
4387  */
4388  __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
4389  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4390  __Pyx_GOTREF(__pyx_t_3);
4391 
4392  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":280
4393  * if self.data_type_name == b'float32':
4394  * self.set_csr_matrix_float(self.A_csr, self.B_csr,
4395  * B_is_identity) # <<<<<<<<<<<<<<
4396  *
4397  * elif self.data_type_name == b'float64':
4398  */
4399  __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
4400  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
4401  __Pyx_GOTREF(__pyx_t_5);
4402  __pyx_t_7 = NULL;
4403  __pyx_t_8 = 0;
4404  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4405  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4406  if (likely(__pyx_t_7)) {
4407  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4408  __Pyx_INCREF(__pyx_t_7);
4409  __Pyx_INCREF(function);
4410  __Pyx_DECREF_SET(__pyx_t_3, function);
4411  __pyx_t_8 = 1;
4412  }
4413  }
4414  #if CYTHON_FAST_PYCALL
4415  if (PyFunction_Check(__pyx_t_3)) {
4416  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4417  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4418  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4419  __Pyx_GOTREF(__pyx_t_4);
4420  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4421  } else
4422  #endif
4423  #if CYTHON_FAST_PYCCALL
4424  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4425  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_5};
4426  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4427  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4428  __Pyx_GOTREF(__pyx_t_4);
4429  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4430  } else
4431  #endif
4432  {
4433  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error)
4434  __Pyx_GOTREF(__pyx_t_9);
4435  if (__pyx_t_7) {
4436  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4437  }
4438  __Pyx_INCREF(__pyx_v_self->A_csr);
4439  __Pyx_GIVEREF(__pyx_v_self->A_csr);
4440  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_self->A_csr);
4441  __Pyx_INCREF(__pyx_v_self->B_csr);
4442  __Pyx_GIVEREF(__pyx_v_self->B_csr);
4443  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_self->B_csr);
4444  __Pyx_GIVEREF(__pyx_t_5);
4445  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4446  __pyx_t_5 = 0;
4447  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
4448  __Pyx_GOTREF(__pyx_t_4);
4449  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4450  }
4451  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4452  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4453 
4454  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":278
4455  *
4456  * # CSR matrix
4457  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4458  * self.set_csr_matrix_float(self.A_csr, self.B_csr,
4459  * B_is_identity)
4460  */
4461  goto __pyx_L27;
4462  }
4463 
4464  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":282
4465  * B_is_identity)
4466  *
4467  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4468  * self.set_csr_matrix_double(self.A_csr, self.B_csr,
4469  * B_is_identity)
4470  */
4471  __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4472  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
4473  __Pyx_GOTREF(__pyx_t_4);
4474  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
4475  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4476  if (__pyx_t_2) {
4477 
4478  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":283
4479  *
4480  * elif self.data_type_name == b'float64':
4481  * self.set_csr_matrix_double(self.A_csr, self.B_csr, # <<<<<<<<<<<<<<
4482  * B_is_identity)
4483  *
4484  */
4485  __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
4486  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
4487  __Pyx_GOTREF(__pyx_t_3);
4488 
4489  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":284
4490  * elif self.data_type_name == b'float64':
4491  * self.set_csr_matrix_double(self.A_csr, self.B_csr,
4492  * B_is_identity) # <<<<<<<<<<<<<<
4493  *
4494  * elif self.data_type_name == b'float128':
4495  */
4496  __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error))
4497  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error)
4498  __Pyx_GOTREF(__pyx_t_9);
4499  __pyx_t_5 = NULL;
4500  __pyx_t_8 = 0;
4501  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4502  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4503  if (likely(__pyx_t_5)) {
4504  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4505  __Pyx_INCREF(__pyx_t_5);
4506  __Pyx_INCREF(function);
4507  __Pyx_DECREF_SET(__pyx_t_3, function);
4508  __pyx_t_8 = 1;
4509  }
4510  }
4511  #if CYTHON_FAST_PYCALL
4512  if (PyFunction_Check(__pyx_t_3)) {
4513  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4514  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4515  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4516  __Pyx_GOTREF(__pyx_t_4);
4517  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4518  } else
4519  #endif
4520  #if CYTHON_FAST_PYCCALL
4521  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4522  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_9};
4523  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4524  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4525  __Pyx_GOTREF(__pyx_t_4);
4526  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4527  } else
4528  #endif
4529  {
4530  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
4531  __Pyx_GOTREF(__pyx_t_7);
4532  if (__pyx_t_5) {
4533  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4534  }
4535  __Pyx_INCREF(__pyx_v_self->A_csr);
4536  __Pyx_GIVEREF(__pyx_v_self->A_csr);
4537  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_self->A_csr);
4538  __Pyx_INCREF(__pyx_v_self->B_csr);
4539  __Pyx_GIVEREF(__pyx_v_self->B_csr);
4540  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_self->B_csr);
4541  __Pyx_GIVEREF(__pyx_t_9);
4542  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4543  __pyx_t_9 = 0;
4544  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
4545  __Pyx_GOTREF(__pyx_t_4);
4546  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4547  }
4548  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4549  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4550 
4551  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":282
4552  * B_is_identity)
4553  *
4554  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4555  * self.set_csr_matrix_double(self.A_csr, self.B_csr,
4556  * B_is_identity)
4557  */
4558  goto __pyx_L27;
4559  }
4560 
4561  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":286
4562  * B_is_identity)
4563  *
4564  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4565  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr,
4566  * B_is_identity)
4567  */
4568  __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4569  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
4570  __Pyx_GOTREF(__pyx_t_4);
4571  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4572  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4573  if (__pyx_t_2) {
4574 
4575  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":287
4576  *
4577  * elif self.data_type_name == b'float128':
4578  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr, # <<<<<<<<<<<<<<
4579  * B_is_identity)
4580  *
4581  */
4582  __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4583  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
4584  __Pyx_GOTREF(__pyx_t_3);
4585 
4586  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":288
4587  * elif self.data_type_name == b'float128':
4588  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr,
4589  * B_is_identity) # <<<<<<<<<<<<<<
4590  *
4591  * else:
4592  */
4593  __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4594  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error)
4595  __Pyx_GOTREF(__pyx_t_7);
4596  __pyx_t_9 = NULL;
4597  __pyx_t_8 = 0;
4598  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4599  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4600  if (likely(__pyx_t_9)) {
4601  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4602  __Pyx_INCREF(__pyx_t_9);
4603  __Pyx_INCREF(function);
4604  __Pyx_DECREF_SET(__pyx_t_3, function);
4605  __pyx_t_8 = 1;
4606  }
4607  }
4608  #if CYTHON_FAST_PYCALL
4609  if (PyFunction_Check(__pyx_t_3)) {
4610  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4611  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4612  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4613  __Pyx_GOTREF(__pyx_t_4);
4614  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4615  } else
4616  #endif
4617  #if CYTHON_FAST_PYCCALL
4618  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4619  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_self->A_csr, __pyx_v_self->B_csr, __pyx_t_7};
4620  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4621  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4622  __Pyx_GOTREF(__pyx_t_4);
4623  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4624  } else
4625  #endif
4626  {
4627  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
4628  __Pyx_GOTREF(__pyx_t_5);
4629  if (__pyx_t_9) {
4630  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4631  }
4632  __Pyx_INCREF(__pyx_v_self->A_csr);
4633  __Pyx_GIVEREF(__pyx_v_self->A_csr);
4634  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_self->A_csr);
4635  __Pyx_INCREF(__pyx_v_self->B_csr);
4636  __Pyx_GIVEREF(__pyx_v_self->B_csr);
4637  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_self->B_csr);
4638  __Pyx_GIVEREF(__pyx_t_7);
4639  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4640  __pyx_t_7 = 0;
4641  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
4642  __Pyx_GOTREF(__pyx_t_4);
4643  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4644  }
4645  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4646  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4647 
4648  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":286
4649  * B_is_identity)
4650  *
4651  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4652  * self.set_csr_matrix_long_double(self.A_csr, self.B_csr,
4653  * B_is_identity)
4654  */
4655  }
4656  __pyx_L27:;
4657  }
4658  __pyx_L11:;
4659 
4660  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":219
4661  *
4662  * # Determine A is sparse or dense
4663  * if issparse(A): # <<<<<<<<<<<<<<
4664  *
4665  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
4666  */
4667  goto __pyx_L10;
4668  }
4669 
4670  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":293
4671  *
4672  * # Set a dense matrix
4673  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4674  * self.set_dense_matrix_float(A, B, B_is_identity)
4675  *
4676  */
4677  __Pyx_TraceLine(293,0,__PYX_ERR(0, 293, __pyx_L1_error))
4678  /*else*/ {
4679  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
4680  __Pyx_GOTREF(__pyx_t_4);
4681  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
4682  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4683  if (__pyx_t_2) {
4684 
4685  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":294
4686  * # Set a dense matrix
4687  * if self.data_type_name == b'float32':
4688  * self.set_dense_matrix_float(A, B, B_is_identity) # <<<<<<<<<<<<<<
4689  *
4690  * elif self.data_type_name == b'float64':
4691  */
4692  __Pyx_TraceLine(294,0,__PYX_ERR(0, 294, __pyx_L1_error))
4693  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
4694  __Pyx_GOTREF(__pyx_t_3);
4695  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
4696  __Pyx_GOTREF(__pyx_t_5);
4697  __pyx_t_7 = NULL;
4698  __pyx_t_8 = 0;
4699  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4700  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4701  if (likely(__pyx_t_7)) {
4702  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4703  __Pyx_INCREF(__pyx_t_7);
4704  __Pyx_INCREF(function);
4705  __Pyx_DECREF_SET(__pyx_t_3, function);
4706  __pyx_t_8 = 1;
4707  }
4708  }
4709  #if CYTHON_FAST_PYCALL
4710  if (PyFunction_Check(__pyx_t_3)) {
4711  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4712  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4713  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4714  __Pyx_GOTREF(__pyx_t_4);
4715  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4716  } else
4717  #endif
4718  #if CYTHON_FAST_PYCCALL
4719  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4720  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_A, __pyx_v_B, __pyx_t_5};
4721  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4722  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4723  __Pyx_GOTREF(__pyx_t_4);
4724  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4725  } else
4726  #endif
4727  {
4728  __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error)
4729  __Pyx_GOTREF(__pyx_t_9);
4730  if (__pyx_t_7) {
4731  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4732  }
4733  __Pyx_INCREF(__pyx_v_A);
4734  __Pyx_GIVEREF(__pyx_v_A);
4735  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_A);
4736  __Pyx_INCREF(__pyx_v_B);
4737  __Pyx_GIVEREF(__pyx_v_B);
4738  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_B);
4739  __Pyx_GIVEREF(__pyx_t_5);
4740  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4741  __pyx_t_5 = 0;
4742  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
4743  __Pyx_GOTREF(__pyx_t_4);
4744  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4745  }
4746  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4747  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4748 
4749  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":293
4750  *
4751  * # Set a dense matrix
4752  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
4753  * self.set_dense_matrix_float(A, B, B_is_identity)
4754  *
4755  */
4756  goto __pyx_L28;
4757  }
4758 
4759  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":296
4760  * self.set_dense_matrix_float(A, B, B_is_identity)
4761  *
4762  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4763  * self.set_dense_matrix_double(A, B, B_is_identity)
4764  *
4765  */
4766  __Pyx_TraceLine(296,0,__PYX_ERR(0, 296, __pyx_L1_error))
4767  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
4768  __Pyx_GOTREF(__pyx_t_4);
4769  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
4770  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4771  if (__pyx_t_2) {
4772 
4773  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":297
4774  *
4775  * elif self.data_type_name == b'float64':
4776  * self.set_dense_matrix_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
4777  *
4778  * elif self.data_type_name == b'float128':
4779  */
4780  __Pyx_TraceLine(297,0,__PYX_ERR(0, 297, __pyx_L1_error))
4781  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
4782  __Pyx_GOTREF(__pyx_t_3);
4783  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 297, __pyx_L1_error)
4784  __Pyx_GOTREF(__pyx_t_9);
4785  __pyx_t_5 = NULL;
4786  __pyx_t_8 = 0;
4787  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4788  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4789  if (likely(__pyx_t_5)) {
4790  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4791  __Pyx_INCREF(__pyx_t_5);
4792  __Pyx_INCREF(function);
4793  __Pyx_DECREF_SET(__pyx_t_3, function);
4794  __pyx_t_8 = 1;
4795  }
4796  }
4797  #if CYTHON_FAST_PYCALL
4798  if (PyFunction_Check(__pyx_t_3)) {
4799  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4800  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
4801  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4802  __Pyx_GOTREF(__pyx_t_4);
4803  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4804  } else
4805  #endif
4806  #if CYTHON_FAST_PYCCALL
4807  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4808  PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_A, __pyx_v_B, __pyx_t_9};
4809  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
4810  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4811  __Pyx_GOTREF(__pyx_t_4);
4812  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4813  } else
4814  #endif
4815  {
4816  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
4817  __Pyx_GOTREF(__pyx_t_7);
4818  if (__pyx_t_5) {
4819  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4820  }
4821  __Pyx_INCREF(__pyx_v_A);
4822  __Pyx_GIVEREF(__pyx_v_A);
4823  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_A);
4824  __Pyx_INCREF(__pyx_v_B);
4825  __Pyx_GIVEREF(__pyx_v_B);
4826  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_B);
4827  __Pyx_GIVEREF(__pyx_t_9);
4828  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_9);
4829  __pyx_t_9 = 0;
4830  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
4831  __Pyx_GOTREF(__pyx_t_4);
4832  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4833  }
4834  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4835  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4836 
4837  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":296
4838  * self.set_dense_matrix_float(A, B, B_is_identity)
4839  *
4840  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
4841  * self.set_dense_matrix_double(A, B, B_is_identity)
4842  *
4843  */
4844  goto __pyx_L28;
4845  }
4846 
4847  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":299
4848  * self.set_dense_matrix_double(A, B, B_is_identity)
4849  *
4850  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4851  * self.set_dense_matrix_long_double(A, B, B_is_identity)
4852  *
4853  */
4854  __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
4855  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
4856  __Pyx_GOTREF(__pyx_t_4);
4857  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
4858  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4859  if (__pyx_t_2) {
4860 
4861  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":300
4862  *
4863  * elif self.data_type_name == b'float128':
4864  * self.set_dense_matrix_long_double(A, B, B_is_identity) # <<<<<<<<<<<<<<
4865  *
4866  * # ======================
4867  */
4868  __Pyx_TraceLine(300,0,__PYX_ERR(0, 300, __pyx_L1_error))
4869  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
4870  __Pyx_GOTREF(__pyx_t_3);
4871  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_B_is_identity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
4872  __Pyx_GOTREF(__pyx_t_7);
4873  __pyx_t_9 = NULL;
4874  __pyx_t_8 = 0;
4875  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4876  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
4877  if (likely(__pyx_t_9)) {
4878  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4879  __Pyx_INCREF(__pyx_t_9);
4880  __Pyx_INCREF(function);
4881  __Pyx_DECREF_SET(__pyx_t_3, function);
4882  __pyx_t_8 = 1;
4883  }
4884  }
4885  #if CYTHON_FAST_PYCALL
4886  if (PyFunction_Check(__pyx_t_3)) {
4887  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4888  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
4889  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4890  __Pyx_GOTREF(__pyx_t_4);
4891  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4892  } else
4893  #endif
4894  #if CYTHON_FAST_PYCCALL
4895  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4896  PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_A, __pyx_v_B, __pyx_t_7};
4897  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
4898  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4899  __Pyx_GOTREF(__pyx_t_4);
4900  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4901  } else
4902  #endif
4903  {
4904  __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
4905  __Pyx_GOTREF(__pyx_t_5);
4906  if (__pyx_t_9) {
4907  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
4908  }
4909  __Pyx_INCREF(__pyx_v_A);
4910  __Pyx_GIVEREF(__pyx_v_A);
4911  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_A);
4912  __Pyx_INCREF(__pyx_v_B);
4913  __Pyx_GIVEREF(__pyx_v_B);
4914  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_B);
4915  __Pyx_GIVEREF(__pyx_t_7);
4916  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_t_7);
4917  __pyx_t_7 = 0;
4918  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
4919  __Pyx_GOTREF(__pyx_t_4);
4920  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4921  }
4922  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4923  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4924 
4925  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":299
4926  * self.set_dense_matrix_double(A, B, B_is_identity)
4927  *
4928  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4929  * self.set_dense_matrix_long_double(A, B, B_is_identity)
4930  *
4931  */
4932  }
4933  __pyx_L28:;
4934  }
4935  __pyx_L10:;
4936 
4937  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":172
4938  * # =========
4939  *
4940  * def __cinit__(self, A, B=None): # <<<<<<<<<<<<<<
4941  * """
4942  * Sets matrices A and B.
4943  */
4944 
4945  /* function exit code */
4946  __pyx_r = 0;
4947  goto __pyx_L0;
4948  __pyx_L1_error:;
4949  __Pyx_XDECREF(__pyx_t_3);
4950  __Pyx_XDECREF(__pyx_t_4);
4951  __Pyx_XDECREF(__pyx_t_5);
4952  __Pyx_XDECREF(__pyx_t_7);
4953  __Pyx_XDECREF(__pyx_t_9);
4954  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4955  __pyx_r = -1;
4956  __pyx_L0:;
4957  __Pyx_TraceReturn(Py_None, 0);
4958  __Pyx_RefNannyFinishContext();
4959  return __pyx_r;
4960 }
4961 
4962 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
4963  * # ======================
4964  *
4965  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
4966  * """
4967  * Sets matrix A.
4968  */
4969 
4970 /* Python wrapper */
4971 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4972 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float[] = "pycAffineMatrixFunction.set_dense_matrix_float(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4973 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float = {"set_dense_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float};
4974 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4975  PyObject *__pyx_v_A = 0;
4976  PyObject *__pyx_v_B = 0;
4977  PyObject *__pyx_v_B_is_identity = 0;
4978  int __pyx_lineno = 0;
4979  const char *__pyx_filename = NULL;
4980  int __pyx_clineno = 0;
4981  PyObject *__pyx_r = 0;
4982  __Pyx_RefNannyDeclarations
4983  __Pyx_RefNannySetupContext("set_dense_matrix_float (wrapper)", 0);
4984  {
4985  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
4986  PyObject* values[3] = {0,0,0};
4987  if (unlikely(__pyx_kwds)) {
4988  Py_ssize_t kw_args;
4989  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4990  switch (pos_args) {
4991  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4992  CYTHON_FALLTHROUGH;
4993  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4994  CYTHON_FALLTHROUGH;
4995  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4996  CYTHON_FALLTHROUGH;
4997  case 0: break;
4998  default: goto __pyx_L5_argtuple_error;
4999  }
5000  kw_args = PyDict_Size(__pyx_kwds);
5001  switch (pos_args) {
5002  case 0:
5003  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5004  else goto __pyx_L5_argtuple_error;
5005  CYTHON_FALLTHROUGH;
5006  case 1:
5007  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5008  else {
5009  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 306, __pyx_L3_error)
5010  }
5011  CYTHON_FALLTHROUGH;
5012  case 2:
5013  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5014  else {
5015  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 306, __pyx_L3_error)
5016  }
5017  }
5018  if (unlikely(kw_args > 0)) {
5019  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_dense_matrix_float") < 0)) __PYX_ERR(0, 306, __pyx_L3_error)
5020  }
5021  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5022  goto __pyx_L5_argtuple_error;
5023  } else {
5024  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5025  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5026  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5027  }
5028  __pyx_v_A = values[0];
5029  __pyx_v_B = values[1];
5030  __pyx_v_B_is_identity = values[2];
5031  }
5032  goto __pyx_L4_argument_unpacking_done;
5033  __pyx_L5_argtuple_error:;
5034  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 306, __pyx_L3_error)
5035  __pyx_L3_error:;
5036  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5037  __Pyx_RefNannyFinishContext();
5038  return NULL;
5039  __pyx_L4_argument_unpacking_done:;
5040  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5041 
5042  /* function exit code */
5043  __Pyx_RefNannyFinishContext();
5044  return __pyx_r;
5045 }
5046 
5047 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5048  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5049  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5050  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5051  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5052  __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5053  __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5054  __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5055  __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5056  float *__pyx_v_A_data;
5057  float *__pyx_v_B_data;
5058  PyObject *__pyx_r = NULL;
5059  __Pyx_TraceDeclarations
5060  __Pyx_RefNannyDeclarations
5061  PyObject *__pyx_t_1 = NULL;
5062  PyObject *__pyx_t_2 = NULL;
5063  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5064  int __pyx_t_4;
5065  int __pyx_t_5;
5066  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5067  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5068  Py_ssize_t __pyx_t_8;
5069  Py_ssize_t __pyx_t_9;
5071  int __pyx_lineno = 0;
5072  const char *__pyx_filename = NULL;
5073  int __pyx_clineno = 0;
5074  __Pyx_TraceFrameInit(__pyx_codeobj__7)
5075  __Pyx_RefNannySetupContext("set_dense_matrix_float", 0);
5076  __Pyx_TraceCall("set_dense_matrix_float", __pyx_f[0], 306, 0, __PYX_ERR(0, 306, __pyx_L1_error));
5077 
5078  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":315
5079  *
5080  * # Matrix size
5081  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5082  * cdef LongIndexType A_num_columns = A.shape[1]
5083  *
5084  */
5085  __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
5086  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
5087  __Pyx_GOTREF(__pyx_t_1);
5088  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
5089  __Pyx_GOTREF(__pyx_t_2);
5090  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5091  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L1_error)
5092  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5093  __pyx_v_A_num_rows = __pyx_t_3;
5094 
5095  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":316
5096  * # Matrix size
5097  * cdef LongIndexType A_num_rows = A.shape[0]
5098  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5099  *
5100  * # Contiguity
5101  */
5102  __Pyx_TraceLine(316,0,__PYX_ERR(0, 316, __pyx_L1_error))
5103  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
5104  __Pyx_GOTREF(__pyx_t_2);
5105  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
5106  __Pyx_GOTREF(__pyx_t_1);
5107  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5108  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L1_error)
5109  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5110  __pyx_v_A_num_columns = __pyx_t_3;
5111 
5112  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":320
5113  * # Contiguity
5114  * cdef FlagType A_is_row_major
5115  * cdef FlagType B_is_row_major = 0 # <<<<<<<<<<<<<<
5116  *
5117  * if A.flags['C_CONTIGUOUS']:
5118  */
5119  __Pyx_TraceLine(320,0,__PYX_ERR(0, 320, __pyx_L1_error))
5120  __pyx_v_B_is_row_major = 0;
5121 
5122  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":322
5123  * cdef FlagType B_is_row_major = 0
5124  *
5125  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5126  * A_is_row_major = 1
5127  * elif A.flags['F_CONTIGUOUS']:
5128  */
5129  __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error))
5130  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
5131  __Pyx_GOTREF(__pyx_t_1);
5132  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
5133  __Pyx_GOTREF(__pyx_t_2);
5134  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5135  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
5136  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5137  if (__pyx_t_4) {
5138 
5139  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":323
5140  *
5141  * if A.flags['C_CONTIGUOUS']:
5142  * A_is_row_major = 1 # <<<<<<<<<<<<<<
5143  * elif A.flags['F_CONTIGUOUS']:
5144  * A_is_row_major = 0
5145  */
5146  __Pyx_TraceLine(323,0,__PYX_ERR(0, 323, __pyx_L1_error))
5147  __pyx_v_A_is_row_major = 1;
5148 
5149  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":322
5150  * cdef FlagType B_is_row_major = 0
5151  *
5152  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5153  * A_is_row_major = 1
5154  * elif A.flags['F_CONTIGUOUS']:
5155  */
5156  goto __pyx_L3;
5157  }
5158 
5159  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":324
5160  * if A.flags['C_CONTIGUOUS']:
5161  * A_is_row_major = 1
5162  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5163  * A_is_row_major = 0
5164  * else:
5165  */
5166  __Pyx_TraceLine(324,0,__PYX_ERR(0, 324, __pyx_L1_error))
5167  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
5168  __Pyx_GOTREF(__pyx_t_2);
5169  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
5170  __Pyx_GOTREF(__pyx_t_1);
5171  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5172  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
5173  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5174  if (likely(__pyx_t_4)) {
5175 
5176  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":325
5177  * A_is_row_major = 1
5178  * elif A.flags['F_CONTIGUOUS']:
5179  * A_is_row_major = 0 # <<<<<<<<<<<<<<
5180  * else:
5181  * raise TypeError('Matrix A should be either C or F contiguous.')
5182  */
5183  __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5184  __pyx_v_A_is_row_major = 0;
5185 
5186  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":324
5187  * if A.flags['C_CONTIGUOUS']:
5188  * A_is_row_major = 1
5189  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5190  * A_is_row_major = 0
5191  * else:
5192  */
5193  goto __pyx_L3;
5194  }
5195 
5196  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":327
5197  * A_is_row_major = 0
5198  * else:
5199  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
5200  *
5201  * if not B_is_identity:
5202  */
5203  __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
5204  /*else*/ {
5205  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
5206  __Pyx_GOTREF(__pyx_t_1);
5207  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5208  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5209  __PYX_ERR(0, 327, __pyx_L1_error)
5210  }
5211  __pyx_L3:;
5212 
5213  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":329
5214  * raise TypeError('Matrix A should be either C or F contiguous.')
5215  *
5216  * if not B_is_identity: # <<<<<<<<<<<<<<
5217  * if B.flags['C_CONTIGUOUS']:
5218  * B_is_row_major = 1
5219  */
5220  __Pyx_TraceLine(329,0,__PYX_ERR(0, 329, __pyx_L1_error))
5221  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
5222  __pyx_t_5 = ((!__pyx_t_4) != 0);
5223  if (__pyx_t_5) {
5224 
5225  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":330
5226  *
5227  * if not B_is_identity:
5228  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5229  * B_is_row_major = 1
5230  * elif B.flags['F_CONTIGUOUS']:
5231  */
5232  __Pyx_TraceLine(330,0,__PYX_ERR(0, 330, __pyx_L1_error))
5233  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
5234  __Pyx_GOTREF(__pyx_t_1);
5235  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
5236  __Pyx_GOTREF(__pyx_t_2);
5237  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5238  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
5239  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5240  if (__pyx_t_5) {
5241 
5242  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":331
5243  * if not B_is_identity:
5244  * if B.flags['C_CONTIGUOUS']:
5245  * B_is_row_major = 1 # <<<<<<<<<<<<<<
5246  * elif B.flags['F_CONTIGUOUS']:
5247  * B_is_row_major = 0
5248  */
5249  __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error))
5250  __pyx_v_B_is_row_major = 1;
5251 
5252  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":330
5253  *
5254  * if not B_is_identity:
5255  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5256  * B_is_row_major = 1
5257  * elif B.flags['F_CONTIGUOUS']:
5258  */
5259  goto __pyx_L5;
5260  }
5261 
5262  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":332
5263  * if B.flags['C_CONTIGUOUS']:
5264  * B_is_row_major = 1
5265  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5266  * B_is_row_major = 0
5267  * else:
5268  */
5269  __Pyx_TraceLine(332,0,__PYX_ERR(0, 332, __pyx_L1_error))
5270  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
5271  __Pyx_GOTREF(__pyx_t_2);
5272  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
5273  __Pyx_GOTREF(__pyx_t_1);
5274  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5275  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
5276  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5277  if (likely(__pyx_t_5)) {
5278 
5279  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":333
5280  * B_is_row_major = 1
5281  * elif B.flags['F_CONTIGUOUS']:
5282  * B_is_row_major = 0 # <<<<<<<<<<<<<<
5283  * else:
5284  * raise TypeError('Matrix B should be either C or F contiguous.')
5285  */
5286  __Pyx_TraceLine(333,0,__PYX_ERR(0, 333, __pyx_L1_error))
5287  __pyx_v_B_is_row_major = 0;
5288 
5289  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":332
5290  * if B.flags['C_CONTIGUOUS']:
5291  * B_is_row_major = 1
5292  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5293  * B_is_row_major = 0
5294  * else:
5295  */
5296  goto __pyx_L5;
5297  }
5298 
5299  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":335
5300  * B_is_row_major = 0
5301  * else:
5302  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
5303  *
5304  * # Declare memoryviews to get data pointer
5305  */
5306  __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error))
5307  /*else*/ {
5308  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
5309  __Pyx_GOTREF(__pyx_t_1);
5310  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5311  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5312  __PYX_ERR(0, 335, __pyx_L1_error)
5313  }
5314  __pyx_L5:;
5315 
5316  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":329
5317  * raise TypeError('Matrix A should be either C or F contiguous.')
5318  *
5319  * if not B_is_identity: # <<<<<<<<<<<<<<
5320  * if B.flags['C_CONTIGUOUS']:
5321  * B_is_row_major = 1
5322  */
5323  }
5324 
5325  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":340
5326  * cdef float[:, ::1] A_data_mv_c
5327  * cdef float[::1, :] A_data_mv_f
5328  * cdef float[:, ::1] B_data_mv_c = None # <<<<<<<<<<<<<<
5329  * cdef float[::1, :] B_data_mv_f = None
5330  *
5331  */
5332  __Pyx_TraceLine(340,0,__PYX_ERR(0, 340, __pyx_L1_error))
5333  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 340, __pyx_L1_error)
5334  __pyx_v_B_data_mv_c = __pyx_t_6;
5335  __pyx_t_6.memview = NULL;
5336  __pyx_t_6.data = NULL;
5337 
5338  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":341
5339  * cdef float[::1, :] A_data_mv_f
5340  * cdef float[:, ::1] B_data_mv_c = None
5341  * cdef float[::1, :] B_data_mv_f = None # <<<<<<<<<<<<<<
5342  *
5343  * # Declare pointer of A.data and B.data
5344  */
5345  __Pyx_TraceLine(341,0,__PYX_ERR(0, 341, __pyx_L1_error))
5346  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 341, __pyx_L1_error)
5347  __pyx_v_B_data_mv_f = __pyx_t_7;
5348  __pyx_t_7.memview = NULL;
5349  __pyx_t_7.data = NULL;
5350 
5351  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":345
5352  * # Declare pointer of A.data and B.data
5353  * cdef float* A_data
5354  * cdef float* B_data = NULL # <<<<<<<<<<<<<<
5355  *
5356  * # Get pointer to data of A depending on row or column major
5357  */
5358  __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
5359  __pyx_v_B_data = NULL;
5360 
5361  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":348
5362  *
5363  * # Get pointer to data of A depending on row or column major
5364  * if A_is_row_major: # <<<<<<<<<<<<<<
5365  *
5366  * # Memoryview of A for row major matrix
5367  */
5368  __Pyx_TraceLine(348,0,__PYX_ERR(0, 348, __pyx_L1_error))
5369  __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
5370  if (__pyx_t_5) {
5371 
5372  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":351
5373  *
5374  * # Memoryview of A for row major matrix
5375  * A_data_mv_c = A # <<<<<<<<<<<<<<
5376  *
5377  * # Pointer of the data of A
5378  */
5379  __Pyx_TraceLine(351,0,__PYX_ERR(0, 351, __pyx_L1_error))
5380  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 351, __pyx_L1_error)
5381  __pyx_v_A_data_mv_c = __pyx_t_6;
5382  __pyx_t_6.memview = NULL;
5383  __pyx_t_6.data = NULL;
5384 
5385  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":354
5386  *
5387  * # Pointer of the data of A
5388  * A_data = &A_data_mv_c[0, 0] # <<<<<<<<<<<<<<
5389  *
5390  * else:
5391  */
5392  __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error))
5393  __pyx_t_8 = 0;
5394  __pyx_t_9 = 0;
5395  __pyx_v_A_data = (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5396 
5397  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":348
5398  *
5399  * # Get pointer to data of A depending on row or column major
5400  * if A_is_row_major: # <<<<<<<<<<<<<<
5401  *
5402  * # Memoryview of A for row major matrix
5403  */
5404  goto __pyx_L6;
5405  }
5406 
5407  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":359
5408  *
5409  * # Memoryview of A for column major matrix
5410  * A_data_mv_f = A # <<<<<<<<<<<<<<
5411  *
5412  * # Pointer of the data of A
5413  */
5414  __Pyx_TraceLine(359,0,__PYX_ERR(0, 359, __pyx_L1_error))
5415  /*else*/ {
5416  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 359, __pyx_L1_error)
5417  __pyx_v_A_data_mv_f = __pyx_t_7;
5418  __pyx_t_7.memview = NULL;
5419  __pyx_t_7.data = NULL;
5420 
5421  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":362
5422  *
5423  * # Pointer of the data of A
5424  * A_data = &A_data_mv_f[0, 0] # <<<<<<<<<<<<<<
5425  *
5426  * # Get pointer to data of B depending on row or column major
5427  */
5428  __Pyx_TraceLine(362,0,__PYX_ERR(0, 362, __pyx_L1_error))
5429  __pyx_t_9 = 0;
5430  __pyx_t_8 = 0;
5431  __pyx_v_A_data = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
5432  }
5433  __pyx_L6:;
5434 
5435  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":365
5436  *
5437  * # Get pointer to data of B depending on row or column major
5438  * if not B_is_identity: # <<<<<<<<<<<<<<
5439  * if B_is_row_major:
5440  *
5441  */
5442  __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error))
5443  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
5444  __pyx_t_4 = ((!__pyx_t_5) != 0);
5445  if (__pyx_t_4) {
5446 
5447  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":366
5448  * # Get pointer to data of B depending on row or column major
5449  * if not B_is_identity:
5450  * if B_is_row_major: # <<<<<<<<<<<<<<
5451  *
5452  * # Memoryview of B for row major matrix
5453  */
5454  __Pyx_TraceLine(366,0,__PYX_ERR(0, 366, __pyx_L1_error))
5455  __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
5456  if (__pyx_t_4) {
5457 
5458  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":369
5459  *
5460  * # Memoryview of B for row major matrix
5461  * B_data_mv_c = B # <<<<<<<<<<<<<<
5462  *
5463  * # Pointer of the data of B
5464  */
5465  __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error))
5466  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 369, __pyx_L1_error)
5467  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5468  __pyx_v_B_data_mv_c = __pyx_t_6;
5469  __pyx_t_6.memview = NULL;
5470  __pyx_t_6.data = NULL;
5471 
5472  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":372
5473  *
5474  * # Pointer of the data of B
5475  * B_data = &B_data_mv_c[0, 0] # <<<<<<<<<<<<<<
5476  *
5477  * else:
5478  */
5479  __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error))
5480  __pyx_t_8 = 0;
5481  __pyx_t_9 = 0;
5482  __pyx_v_B_data = (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
5483 
5484  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":366
5485  * # Get pointer to data of B depending on row or column major
5486  * if not B_is_identity:
5487  * if B_is_row_major: # <<<<<<<<<<<<<<
5488  *
5489  * # Memoryview of B for row major matrix
5490  */
5491  goto __pyx_L8;
5492  }
5493 
5494  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":377
5495  *
5496  * # Memoryview of B for column major matrix
5497  * B_data_mv_f = B # <<<<<<<<<<<<<<
5498  *
5499  * # Pointer of the data of B
5500  */
5501  __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error))
5502  /*else*/ {
5503  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 377, __pyx_L1_error)
5504  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5505  __pyx_v_B_data_mv_f = __pyx_t_7;
5506  __pyx_t_7.memview = NULL;
5507  __pyx_t_7.data = NULL;
5508 
5509  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":380
5510  *
5511  * # Pointer of the data of B
5512  * B_data = &B_data_mv_f[0, 0] # <<<<<<<<<<<<<<
5513  *
5514  * # Create a linear operator object
5515  */
5516  __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
5517  __pyx_t_9 = 0;
5518  __pyx_t_8 = 0;
5519  __pyx_v_B_data = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
5520  }
5521  __pyx_L8:;
5522 
5523  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":365
5524  *
5525  * # Get pointer to data of B depending on row or column major
5526  * if not B_is_identity: # <<<<<<<<<<<<<<
5527  * if B_is_row_major:
5528  *
5529  */
5530  }
5531 
5532  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":383
5533  *
5534  * # Create a linear operator object
5535  * if B_is_identity: # <<<<<<<<<<<<<<
5536  * self.Aop_float = new cDenseAffineMatrixFunction[float](
5537  * A_data,
5538  */
5539  __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error))
5540  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
5541  if (__pyx_t_4) {
5542 
5543  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":384
5544  * # Create a linear operator object
5545  * if B_is_identity:
5546  * self.Aop_float = new cDenseAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
5547  * A_data,
5548  * A_is_row_major,
5549  */
5550  __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
5551  try {
5552  __pyx_t_10 = new cDenseAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5553  } catch(...) {
5554  __Pyx_CppExn2PyErr();
5555  __PYX_ERR(0, 384, __pyx_L1_error)
5556  }
5557  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5558 
5559  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":383
5560  *
5561  * # Create a linear operator object
5562  * if B_is_identity: # <<<<<<<<<<<<<<
5563  * self.Aop_float = new cDenseAffineMatrixFunction[float](
5564  * A_data,
5565  */
5566  goto __pyx_L9;
5567  }
5568 
5569  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":390
5570  * A_num_columns)
5571  * else:
5572  * self.Aop_float = new cDenseAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
5573  * A_data,
5574  * A_is_row_major,
5575  */
5576  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5577  /*else*/ {
5578 
5579  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":396
5580  * A_num_columns,
5581  * B_data,
5582  * B_is_row_major) # <<<<<<<<<<<<<<
5583  *
5584  * # =======================
5585  */
5586  __Pyx_TraceLine(396,0,__PYX_ERR(0, 396, __pyx_L1_error))
5587  try {
5588  __pyx_t_10 = new cDenseAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
5589  } catch(...) {
5590  __Pyx_CppExn2PyErr();
5591  __PYX_ERR(0, 390, __pyx_L1_error)
5592  }
5593 
5594  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":390
5595  * A_num_columns)
5596  * else:
5597  * self.Aop_float = new cDenseAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
5598  * A_data,
5599  * A_is_row_major,
5600  */
5601  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5602  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_10;
5603  }
5604  __pyx_L9:;
5605 
5606  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
5607  * # ======================
5608  *
5609  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
5610  * """
5611  * Sets matrix A.
5612  */
5613 
5614  /* function exit code */
5615  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5616  goto __pyx_L0;
5617  __pyx_L1_error:;
5618  __Pyx_XDECREF(__pyx_t_1);
5619  __Pyx_XDECREF(__pyx_t_2);
5620  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5621  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
5622  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5623  __pyx_r = NULL;
5624  __pyx_L0:;
5625  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
5626  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
5627  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
5628  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
5629  __Pyx_XGIVEREF(__pyx_r);
5630  __Pyx_TraceReturn(__pyx_r, 0);
5631  __Pyx_RefNannyFinishContext();
5632  return __pyx_r;
5633 }
5634 
5635 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
5636  * # =======================
5637  *
5638  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
5639  * """
5640  * Sets matrix A.
5641  */
5642 
5643 /* Python wrapper */
5644 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5645 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double[] = "pycAffineMatrixFunction.set_dense_matrix_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
5646 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double = {"set_dense_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double};
5647 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5648  PyObject *__pyx_v_A = 0;
5649  PyObject *__pyx_v_B = 0;
5650  PyObject *__pyx_v_B_is_identity = 0;
5651  int __pyx_lineno = 0;
5652  const char *__pyx_filename = NULL;
5653  int __pyx_clineno = 0;
5654  PyObject *__pyx_r = 0;
5655  __Pyx_RefNannyDeclarations
5656  __Pyx_RefNannySetupContext("set_dense_matrix_double (wrapper)", 0);
5657  {
5658  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
5659  PyObject* values[3] = {0,0,0};
5660  if (unlikely(__pyx_kwds)) {
5661  Py_ssize_t kw_args;
5662  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5663  switch (pos_args) {
5664  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5665  CYTHON_FALLTHROUGH;
5666  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5667  CYTHON_FALLTHROUGH;
5668  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5669  CYTHON_FALLTHROUGH;
5670  case 0: break;
5671  default: goto __pyx_L5_argtuple_error;
5672  }
5673  kw_args = PyDict_Size(__pyx_kwds);
5674  switch (pos_args) {
5675  case 0:
5676  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5677  else goto __pyx_L5_argtuple_error;
5678  CYTHON_FALLTHROUGH;
5679  case 1:
5680  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5681  else {
5682  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 402, __pyx_L3_error)
5683  }
5684  CYTHON_FALLTHROUGH;
5685  case 2:
5686  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
5687  else {
5688  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 402, __pyx_L3_error)
5689  }
5690  }
5691  if (unlikely(kw_args > 0)) {
5692  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_dense_matrix_double") < 0)) __PYX_ERR(0, 402, __pyx_L3_error)
5693  }
5694  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5695  goto __pyx_L5_argtuple_error;
5696  } else {
5697  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5698  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5699  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5700  }
5701  __pyx_v_A = values[0];
5702  __pyx_v_B = values[1];
5703  __pyx_v_B_is_identity = values[2];
5704  }
5705  goto __pyx_L4_argument_unpacking_done;
5706  __pyx_L5_argtuple_error:;
5707  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error)
5708  __pyx_L3_error:;
5709  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5710  __Pyx_RefNannyFinishContext();
5711  return NULL;
5712  __pyx_L4_argument_unpacking_done:;
5713  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
5714 
5715  /* function exit code */
5716  __Pyx_RefNannyFinishContext();
5717  return __pyx_r;
5718 }
5719 
5720 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
5721  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5722  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5723  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
5724  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
5725  __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5726  __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5727  __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
5728  __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
5729  double *__pyx_v_A_data;
5730  double *__pyx_v_B_data;
5731  PyObject *__pyx_r = NULL;
5732  __Pyx_TraceDeclarations
5733  __Pyx_RefNannyDeclarations
5734  PyObject *__pyx_t_1 = NULL;
5735  PyObject *__pyx_t_2 = NULL;
5736  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5737  int __pyx_t_4;
5738  int __pyx_t_5;
5739  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5740  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
5741  Py_ssize_t __pyx_t_8;
5742  Py_ssize_t __pyx_t_9;
5744  int __pyx_lineno = 0;
5745  const char *__pyx_filename = NULL;
5746  int __pyx_clineno = 0;
5747  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5748  __Pyx_RefNannySetupContext("set_dense_matrix_double", 0);
5749  __Pyx_TraceCall("set_dense_matrix_double", __pyx_f[0], 402, 0, __PYX_ERR(0, 402, __pyx_L1_error));
5750 
5751  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":411
5752  *
5753  * # Matrix size
5754  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5755  * cdef LongIndexType A_num_columns = A.shape[1]
5756  *
5757  */
5758  __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5759  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
5760  __Pyx_GOTREF(__pyx_t_1);
5761  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
5762  __Pyx_GOTREF(__pyx_t_2);
5763  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5764  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
5765  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5766  __pyx_v_A_num_rows = __pyx_t_3;
5767 
5768  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":412
5769  * # Matrix size
5770  * cdef LongIndexType A_num_rows = A.shape[0]
5771  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5772  *
5773  * # Contiguity
5774  */
5775  __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error))
5776  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
5777  __Pyx_GOTREF(__pyx_t_2);
5778  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
5779  __Pyx_GOTREF(__pyx_t_1);
5780  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5781  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
5782  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5783  __pyx_v_A_num_columns = __pyx_t_3;
5784 
5785  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":416
5786  * # Contiguity
5787  * cdef FlagType A_is_row_major
5788  * cdef FlagType B_is_row_major = 0 # <<<<<<<<<<<<<<
5789  *
5790  * if A.flags['C_CONTIGUOUS']:
5791  */
5792  __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error))
5793  __pyx_v_B_is_row_major = 0;
5794 
5795  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":418
5796  * cdef FlagType B_is_row_major = 0
5797  *
5798  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5799  * A_is_row_major = 1
5800  * elif A.flags['F_CONTIGUOUS']:
5801  */
5802  __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error))
5803  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
5804  __Pyx_GOTREF(__pyx_t_1);
5805  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
5806  __Pyx_GOTREF(__pyx_t_2);
5807  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5808  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
5809  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5810  if (__pyx_t_4) {
5811 
5812  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":419
5813  *
5814  * if A.flags['C_CONTIGUOUS']:
5815  * A_is_row_major = 1 # <<<<<<<<<<<<<<
5816  * elif A.flags['F_CONTIGUOUS']:
5817  * A_is_row_major = 0
5818  */
5819  __Pyx_TraceLine(419,0,__PYX_ERR(0, 419, __pyx_L1_error))
5820  __pyx_v_A_is_row_major = 1;
5821 
5822  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":418
5823  * cdef FlagType B_is_row_major = 0
5824  *
5825  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5826  * A_is_row_major = 1
5827  * elif A.flags['F_CONTIGUOUS']:
5828  */
5829  goto __pyx_L3;
5830  }
5831 
5832  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":420
5833  * if A.flags['C_CONTIGUOUS']:
5834  * A_is_row_major = 1
5835  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5836  * A_is_row_major = 0
5837  * else:
5838  */
5839  __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5840  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
5841  __Pyx_GOTREF(__pyx_t_2);
5842  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
5843  __Pyx_GOTREF(__pyx_t_1);
5844  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5845  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
5846  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5847  if (likely(__pyx_t_4)) {
5848 
5849  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":421
5850  * A_is_row_major = 1
5851  * elif A.flags['F_CONTIGUOUS']:
5852  * A_is_row_major = 0 # <<<<<<<<<<<<<<
5853  * else:
5854  * raise TypeError('Matrix A should be either C or F contiguous.')
5855  */
5856  __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error))
5857  __pyx_v_A_is_row_major = 0;
5858 
5859  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":420
5860  * if A.flags['C_CONTIGUOUS']:
5861  * A_is_row_major = 1
5862  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5863  * A_is_row_major = 0
5864  * else:
5865  */
5866  goto __pyx_L3;
5867  }
5868 
5869  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":423
5870  * A_is_row_major = 0
5871  * else:
5872  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
5873  *
5874  * if not B_is_identity:
5875  */
5876  __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error))
5877  /*else*/ {
5878  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
5879  __Pyx_GOTREF(__pyx_t_1);
5880  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5881  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5882  __PYX_ERR(0, 423, __pyx_L1_error)
5883  }
5884  __pyx_L3:;
5885 
5886  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":425
5887  * raise TypeError('Matrix A should be either C or F contiguous.')
5888  *
5889  * if not B_is_identity: # <<<<<<<<<<<<<<
5890  * if B.flags['C_CONTIGUOUS']:
5891  * B_is_row_major = 1
5892  */
5893  __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error))
5894  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
5895  __pyx_t_5 = ((!__pyx_t_4) != 0);
5896  if (__pyx_t_5) {
5897 
5898  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":426
5899  *
5900  * if not B_is_identity:
5901  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5902  * B_is_row_major = 1
5903  * elif B.flags['F_CONTIGUOUS']:
5904  */
5905  __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error))
5906  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
5907  __Pyx_GOTREF(__pyx_t_1);
5908  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
5909  __Pyx_GOTREF(__pyx_t_2);
5910  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5911  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
5912  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5913  if (__pyx_t_5) {
5914 
5915  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":427
5916  * if not B_is_identity:
5917  * if B.flags['C_CONTIGUOUS']:
5918  * B_is_row_major = 1 # <<<<<<<<<<<<<<
5919  * elif B.flags['F_CONTIGUOUS']:
5920  * B_is_row_major = 0
5921  */
5922  __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error))
5923  __pyx_v_B_is_row_major = 1;
5924 
5925  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":426
5926  *
5927  * if not B_is_identity:
5928  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
5929  * B_is_row_major = 1
5930  * elif B.flags['F_CONTIGUOUS']:
5931  */
5932  goto __pyx_L5;
5933  }
5934 
5935  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":428
5936  * if B.flags['C_CONTIGUOUS']:
5937  * B_is_row_major = 1
5938  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5939  * B_is_row_major = 0
5940  * else:
5941  */
5942  __Pyx_TraceLine(428,0,__PYX_ERR(0, 428, __pyx_L1_error))
5943  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
5944  __Pyx_GOTREF(__pyx_t_2);
5945  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
5946  __Pyx_GOTREF(__pyx_t_1);
5947  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5948  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
5949  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5950  if (likely(__pyx_t_5)) {
5951 
5952  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":429
5953  * B_is_row_major = 1
5954  * elif B.flags['F_CONTIGUOUS']:
5955  * B_is_row_major = 0 # <<<<<<<<<<<<<<
5956  * else:
5957  * raise TypeError('Matrix B should be either C or F contiguous.')
5958  */
5959  __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error))
5960  __pyx_v_B_is_row_major = 0;
5961 
5962  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":428
5963  * if B.flags['C_CONTIGUOUS']:
5964  * B_is_row_major = 1
5965  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
5966  * B_is_row_major = 0
5967  * else:
5968  */
5969  goto __pyx_L5;
5970  }
5971 
5972  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":431
5973  * B_is_row_major = 0
5974  * else:
5975  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
5976  *
5977  * # Declare memoryviews to get data pointer
5978  */
5979  __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
5980  /*else*/ {
5981  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
5982  __Pyx_GOTREF(__pyx_t_1);
5983  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5984  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5985  __PYX_ERR(0, 431, __pyx_L1_error)
5986  }
5987  __pyx_L5:;
5988 
5989  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":425
5990  * raise TypeError('Matrix A should be either C or F contiguous.')
5991  *
5992  * if not B_is_identity: # <<<<<<<<<<<<<<
5993  * if B.flags['C_CONTIGUOUS']:
5994  * B_is_row_major = 1
5995  */
5996  }
5997 
5998  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":436
5999  * cdef double[:, ::1] A_data_mv_c
6000  * cdef double[::1, :] A_data_mv_f
6001  * cdef double[:, ::1] B_data_mv_c = None # <<<<<<<<<<<<<<
6002  * cdef double[::1, :] B_data_mv_f = None
6003  *
6004  */
6005  __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
6006  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 436, __pyx_L1_error)
6007  __pyx_v_B_data_mv_c = __pyx_t_6;
6008  __pyx_t_6.memview = NULL;
6009  __pyx_t_6.data = NULL;
6010 
6011  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":437
6012  * cdef double[::1, :] A_data_mv_f
6013  * cdef double[:, ::1] B_data_mv_c = None
6014  * cdef double[::1, :] B_data_mv_f = None # <<<<<<<<<<<<<<
6015  *
6016  * # Declare pointer to A.data and B.data
6017  */
6018  __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
6019  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 437, __pyx_L1_error)
6020  __pyx_v_B_data_mv_f = __pyx_t_7;
6021  __pyx_t_7.memview = NULL;
6022  __pyx_t_7.data = NULL;
6023 
6024  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":441
6025  * # Declare pointer to A.data and B.data
6026  * cdef double* A_data
6027  * cdef double* B_data = NULL # <<<<<<<<<<<<<<
6028  *
6029  * # Get pointer to data of A depending on row or column major
6030  */
6031  __Pyx_TraceLine(441,0,__PYX_ERR(0, 441, __pyx_L1_error))
6032  __pyx_v_B_data = NULL;
6033 
6034  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":444
6035  *
6036  * # Get pointer to data of A depending on row or column major
6037  * if A_is_row_major: # <<<<<<<<<<<<<<
6038  *
6039  * # Memoryview of A for row major matrix
6040  */
6041  __Pyx_TraceLine(444,0,__PYX_ERR(0, 444, __pyx_L1_error))
6042  __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6043  if (__pyx_t_5) {
6044 
6045  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":447
6046  *
6047  * # Memoryview of A for row major matrix
6048  * A_data_mv_c = A # <<<<<<<<<<<<<<
6049  *
6050  * # Pointer of the data of A
6051  */
6052  __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
6053  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 447, __pyx_L1_error)
6054  __pyx_v_A_data_mv_c = __pyx_t_6;
6055  __pyx_t_6.memview = NULL;
6056  __pyx_t_6.data = NULL;
6057 
6058  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":450
6059  *
6060  * # Pointer of the data of A
6061  * A_data = &A_data_mv_c[0, 0] # <<<<<<<<<<<<<<
6062  *
6063  * else:
6064  */
6065  __Pyx_TraceLine(450,0,__PYX_ERR(0, 450, __pyx_L1_error))
6066  __pyx_t_8 = 0;
6067  __pyx_t_9 = 0;
6068  __pyx_v_A_data = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6069 
6070  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":444
6071  *
6072  * # Get pointer to data of A depending on row or column major
6073  * if A_is_row_major: # <<<<<<<<<<<<<<
6074  *
6075  * # Memoryview of A for row major matrix
6076  */
6077  goto __pyx_L6;
6078  }
6079 
6080  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":455
6081  *
6082  * # Memoryview of A for column major matrix
6083  * A_data_mv_f = A # <<<<<<<<<<<<<<
6084  *
6085  * # Pointer of the data of A
6086  */
6087  __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error))
6088  /*else*/ {
6089  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 455, __pyx_L1_error)
6090  __pyx_v_A_data_mv_f = __pyx_t_7;
6091  __pyx_t_7.memview = NULL;
6092  __pyx_t_7.data = NULL;
6093 
6094  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":458
6095  *
6096  * # Pointer of the data of A
6097  * A_data = &A_data_mv_f[0, 0] # <<<<<<<<<<<<<<
6098  *
6099  * # Get pointer to data of B depending on row or column major
6100  */
6101  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
6102  __pyx_t_9 = 0;
6103  __pyx_t_8 = 0;
6104  __pyx_v_A_data = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
6105  }
6106  __pyx_L6:;
6107 
6108  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":461
6109  *
6110  * # Get pointer to data of B depending on row or column major
6111  * if not B_is_identity: # <<<<<<<<<<<<<<
6112  * if B_is_row_major:
6113  *
6114  */
6115  __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
6116  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
6117  __pyx_t_4 = ((!__pyx_t_5) != 0);
6118  if (__pyx_t_4) {
6119 
6120  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":462
6121  * # Get pointer to data of B depending on row or column major
6122  * if not B_is_identity:
6123  * if B_is_row_major: # <<<<<<<<<<<<<<
6124  *
6125  * # Memoryview of B for row major matrix
6126  */
6127  __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error))
6128  __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
6129  if (__pyx_t_4) {
6130 
6131  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":465
6132  *
6133  * # Memoryview of B for row major matrix
6134  * B_data_mv_c = B # <<<<<<<<<<<<<<
6135  *
6136  * # Pointer of the data of B
6137  */
6138  __Pyx_TraceLine(465,0,__PYX_ERR(0, 465, __pyx_L1_error))
6139  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 465, __pyx_L1_error)
6140  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6141  __pyx_v_B_data_mv_c = __pyx_t_6;
6142  __pyx_t_6.memview = NULL;
6143  __pyx_t_6.data = NULL;
6144 
6145  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":468
6146  *
6147  * # Pointer of the data of B
6148  * B_data = &B_data_mv_c[0, 0] # <<<<<<<<<<<<<<
6149  *
6150  * else:
6151  */
6152  __Pyx_TraceLine(468,0,__PYX_ERR(0, 468, __pyx_L1_error))
6153  __pyx_t_8 = 0;
6154  __pyx_t_9 = 0;
6155  __pyx_v_B_data = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6156 
6157  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":462
6158  * # Get pointer to data of B depending on row or column major
6159  * if not B_is_identity:
6160  * if B_is_row_major: # <<<<<<<<<<<<<<
6161  *
6162  * # Memoryview of B for row major matrix
6163  */
6164  goto __pyx_L8;
6165  }
6166 
6167  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":473
6168  *
6169  * # Memoryview of B for column major matrix
6170  * B_data_mv_f = B # <<<<<<<<<<<<<<
6171  *
6172  * # Pointer of the data of B
6173  */
6174  __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error))
6175  /*else*/ {
6176  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 473, __pyx_L1_error)
6177  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6178  __pyx_v_B_data_mv_f = __pyx_t_7;
6179  __pyx_t_7.memview = NULL;
6180  __pyx_t_7.data = NULL;
6181 
6182  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":476
6183  *
6184  * # Pointer of the data of B
6185  * B_data = &B_data_mv_f[0, 0] # <<<<<<<<<<<<<<
6186  *
6187  * # Create a linear operator object
6188  */
6189  __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error))
6190  __pyx_t_9 = 0;
6191  __pyx_t_8 = 0;
6192  __pyx_v_B_data = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
6193  }
6194  __pyx_L8:;
6195 
6196  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":461
6197  *
6198  * # Get pointer to data of B depending on row or column major
6199  * if not B_is_identity: # <<<<<<<<<<<<<<
6200  * if B_is_row_major:
6201  *
6202  */
6203  }
6204 
6205  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":479
6206  *
6207  * # Create a linear operator object
6208  * if B_is_identity: # <<<<<<<<<<<<<<
6209  * self.Aop_double = new cDenseAffineMatrixFunction[double](
6210  * A_data,
6211  */
6212  __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error))
6213  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 479, __pyx_L1_error)
6214  if (__pyx_t_4) {
6215 
6216  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":480
6217  * # Create a linear operator object
6218  * if B_is_identity:
6219  * self.Aop_double = new cDenseAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
6220  * A_data,
6221  * A_is_row_major,
6222  */
6223  __Pyx_TraceLine(480,0,__PYX_ERR(0, 480, __pyx_L1_error))
6224  try {
6225  __pyx_t_10 = new cDenseAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6226  } catch(...) {
6227  __Pyx_CppExn2PyErr();
6228  __PYX_ERR(0, 480, __pyx_L1_error)
6229  }
6230  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6231 
6232  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":479
6233  *
6234  * # Create a linear operator object
6235  * if B_is_identity: # <<<<<<<<<<<<<<
6236  * self.Aop_double = new cDenseAffineMatrixFunction[double](
6237  * A_data,
6238  */
6239  goto __pyx_L9;
6240  }
6241 
6242  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":486
6243  * A_num_columns)
6244  * else:
6245  * self.Aop_double = new cDenseAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
6246  * A_data,
6247  * A_is_row_major,
6248  */
6249  __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6250  /*else*/ {
6251 
6252  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":492
6253  * A_num_columns,
6254  * B_data,
6255  * B_is_row_major) # <<<<<<<<<<<<<<
6256  *
6257  * # ============================
6258  */
6259  __Pyx_TraceLine(492,0,__PYX_ERR(0, 492, __pyx_L1_error))
6260  try {
6261  __pyx_t_10 = new cDenseAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
6262  } catch(...) {
6263  __Pyx_CppExn2PyErr();
6264  __PYX_ERR(0, 486, __pyx_L1_error)
6265  }
6266 
6267  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":486
6268  * A_num_columns)
6269  * else:
6270  * self.Aop_double = new cDenseAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
6271  * A_data,
6272  * A_is_row_major,
6273  */
6274  __Pyx_TraceLine(486,0,__PYX_ERR(0, 486, __pyx_L1_error))
6275  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_10;
6276  }
6277  __pyx_L9:;
6278 
6279  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
6280  * # =======================
6281  *
6282  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
6283  * """
6284  * Sets matrix A.
6285  */
6286 
6287  /* function exit code */
6288  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6289  goto __pyx_L0;
6290  __pyx_L1_error:;
6291  __Pyx_XDECREF(__pyx_t_1);
6292  __Pyx_XDECREF(__pyx_t_2);
6293  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6294  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6295  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6296  __pyx_r = NULL;
6297  __pyx_L0:;
6298  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
6299  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
6300  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6301  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6302  __Pyx_XGIVEREF(__pyx_r);
6303  __Pyx_TraceReturn(__pyx_r, 0);
6304  __Pyx_RefNannyFinishContext();
6305  return __pyx_r;
6306 }
6307 
6308 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
6309  * # ============================
6310  *
6311  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
6312  * """
6313  * Sets matrix A.
6314  */
6315 
6316 /* Python wrapper */
6317 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6318 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double[] = "pycAffineMatrixFunction.set_dense_matrix_long_double(self, A, B, B_is_identity)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
6319 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double = {"set_dense_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double};
6320 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6321  PyObject *__pyx_v_A = 0;
6322  PyObject *__pyx_v_B = 0;
6323  PyObject *__pyx_v_B_is_identity = 0;
6324  int __pyx_lineno = 0;
6325  const char *__pyx_filename = NULL;
6326  int __pyx_clineno = 0;
6327  PyObject *__pyx_r = 0;
6328  __Pyx_RefNannyDeclarations
6329  __Pyx_RefNannySetupContext("set_dense_matrix_long_double (wrapper)", 0);
6330  {
6331  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
6332  PyObject* values[3] = {0,0,0};
6333  if (unlikely(__pyx_kwds)) {
6334  Py_ssize_t kw_args;
6335  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6336  switch (pos_args) {
6337  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6338  CYTHON_FALLTHROUGH;
6339  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6340  CYTHON_FALLTHROUGH;
6341  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6342  CYTHON_FALLTHROUGH;
6343  case 0: break;
6344  default: goto __pyx_L5_argtuple_error;
6345  }
6346  kw_args = PyDict_Size(__pyx_kwds);
6347  switch (pos_args) {
6348  case 0:
6349  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6350  else goto __pyx_L5_argtuple_error;
6351  CYTHON_FALLTHROUGH;
6352  case 1:
6353  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
6354  else {
6355  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 498, __pyx_L3_error)
6356  }
6357  CYTHON_FALLTHROUGH;
6358  case 2:
6359  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
6360  else {
6361  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 498, __pyx_L3_error)
6362  }
6363  }
6364  if (unlikely(kw_args > 0)) {
6365  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_dense_matrix_long_double") < 0)) __PYX_ERR(0, 498, __pyx_L3_error)
6366  }
6367  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6368  goto __pyx_L5_argtuple_error;
6369  } else {
6370  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6371  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6372  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6373  }
6374  __pyx_v_A = values[0];
6375  __pyx_v_B = values[1];
6376  __pyx_v_B_is_identity = values[2];
6377  }
6378  goto __pyx_L4_argument_unpacking_done;
6379  __pyx_L5_argtuple_error:;
6380  __Pyx_RaiseArgtupleInvalid("set_dense_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 498, __pyx_L3_error)
6381  __pyx_L3_error:;
6382  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6383  __Pyx_RefNannyFinishContext();
6384  return NULL;
6385  __pyx_L4_argument_unpacking_done:;
6386  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
6387 
6388  /* function exit code */
6389  __Pyx_RefNannyFinishContext();
6390  return __pyx_r;
6391 }
6392 
6393 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
6394  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6395  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6396  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
6397  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_B_is_row_major;
6398  __Pyx_memviewslice __pyx_v_A_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6399  __Pyx_memviewslice __pyx_v_A_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6400  __Pyx_memviewslice __pyx_v_B_data_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
6401  __Pyx_memviewslice __pyx_v_B_data_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
6402  long double *__pyx_v_A_data;
6403  long double *__pyx_v_B_data;
6404  PyObject *__pyx_r = NULL;
6405  __Pyx_TraceDeclarations
6406  __Pyx_RefNannyDeclarations
6407  PyObject *__pyx_t_1 = NULL;
6408  PyObject *__pyx_t_2 = NULL;
6409  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6410  int __pyx_t_4;
6411  int __pyx_t_5;
6412  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6413  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
6414  Py_ssize_t __pyx_t_8;
6415  Py_ssize_t __pyx_t_9;
6417  int __pyx_lineno = 0;
6418  const char *__pyx_filename = NULL;
6419  int __pyx_clineno = 0;
6420  __Pyx_TraceFrameInit(__pyx_codeobj__11)
6421  __Pyx_RefNannySetupContext("set_dense_matrix_long_double", 0);
6422  __Pyx_TraceCall("set_dense_matrix_long_double", __pyx_f[0], 498, 0, __PYX_ERR(0, 498, __pyx_L1_error));
6423 
6424  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":507
6425  *
6426  * # Matrix size
6427  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6428  * cdef LongIndexType A_num_columns = A.shape[1]
6429  *
6430  */
6431  __Pyx_TraceLine(507,0,__PYX_ERR(0, 507, __pyx_L1_error))
6432  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
6433  __Pyx_GOTREF(__pyx_t_1);
6434  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
6435  __Pyx_GOTREF(__pyx_t_2);
6436  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6437  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
6438  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6439  __pyx_v_A_num_rows = __pyx_t_3;
6440 
6441  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":508
6442  * # Matrix size
6443  * cdef LongIndexType A_num_rows = A.shape[0]
6444  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6445  *
6446  * # Contiguity
6447  */
6448  __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
6449  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
6450  __Pyx_GOTREF(__pyx_t_2);
6451  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
6452  __Pyx_GOTREF(__pyx_t_1);
6453  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6454  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 508, __pyx_L1_error)
6455  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6456  __pyx_v_A_num_columns = __pyx_t_3;
6457 
6458  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":512
6459  * # Contiguity
6460  * cdef FlagType A_is_row_major
6461  * cdef FlagType B_is_row_major = 0 # <<<<<<<<<<<<<<
6462  *
6463  * if A.flags['C_CONTIGUOUS']:
6464  */
6465  __Pyx_TraceLine(512,0,__PYX_ERR(0, 512, __pyx_L1_error))
6466  __pyx_v_B_is_row_major = 0;
6467 
6468  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":514
6469  * cdef FlagType B_is_row_major = 0
6470  *
6471  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6472  * A_is_row_major = 1
6473  * elif A.flags['F_CONTIGUOUS']:
6474  */
6475  __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
6476  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
6477  __Pyx_GOTREF(__pyx_t_1);
6478  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
6479  __Pyx_GOTREF(__pyx_t_2);
6480  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6481  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 514, __pyx_L1_error)
6482  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6483  if (__pyx_t_4) {
6484 
6485  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":515
6486  *
6487  * if A.flags['C_CONTIGUOUS']:
6488  * A_is_row_major = 1 # <<<<<<<<<<<<<<
6489  * elif A.flags['F_CONTIGUOUS']:
6490  * A_is_row_major = 0
6491  */
6492  __Pyx_TraceLine(515,0,__PYX_ERR(0, 515, __pyx_L1_error))
6493  __pyx_v_A_is_row_major = 1;
6494 
6495  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":514
6496  * cdef FlagType B_is_row_major = 0
6497  *
6498  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6499  * A_is_row_major = 1
6500  * elif A.flags['F_CONTIGUOUS']:
6501  */
6502  goto __pyx_L3;
6503  }
6504 
6505  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":516
6506  * if A.flags['C_CONTIGUOUS']:
6507  * A_is_row_major = 1
6508  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6509  * A_is_row_major = 0
6510  * else:
6511  */
6512  __Pyx_TraceLine(516,0,__PYX_ERR(0, 516, __pyx_L1_error))
6513  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
6514  __Pyx_GOTREF(__pyx_t_2);
6515  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
6516  __Pyx_GOTREF(__pyx_t_1);
6517  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6518  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
6519  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6520  if (likely(__pyx_t_4)) {
6521 
6522  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":517
6523  * A_is_row_major = 1
6524  * elif A.flags['F_CONTIGUOUS']:
6525  * A_is_row_major = 0 # <<<<<<<<<<<<<<
6526  * else:
6527  * raise TypeError('Matrix A should be either C or F contiguous.')
6528  */
6529  __Pyx_TraceLine(517,0,__PYX_ERR(0, 517, __pyx_L1_error))
6530  __pyx_v_A_is_row_major = 0;
6531 
6532  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":516
6533  * if A.flags['C_CONTIGUOUS']:
6534  * A_is_row_major = 1
6535  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6536  * A_is_row_major = 0
6537  * else:
6538  */
6539  goto __pyx_L3;
6540  }
6541 
6542  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":519
6543  * A_is_row_major = 0
6544  * else:
6545  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
6546  *
6547  * if not B_is_identity:
6548  */
6549  __Pyx_TraceLine(519,0,__PYX_ERR(0, 519, __pyx_L1_error))
6550  /*else*/ {
6551  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
6552  __Pyx_GOTREF(__pyx_t_1);
6553  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6554  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6555  __PYX_ERR(0, 519, __pyx_L1_error)
6556  }
6557  __pyx_L3:;
6558 
6559  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":521
6560  * raise TypeError('Matrix A should be either C or F contiguous.')
6561  *
6562  * if not B_is_identity: # <<<<<<<<<<<<<<
6563  * if B.flags['C_CONTIGUOUS']:
6564  * B_is_row_major = 1
6565  */
6566  __Pyx_TraceLine(521,0,__PYX_ERR(0, 521, __pyx_L1_error))
6567  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
6568  __pyx_t_5 = ((!__pyx_t_4) != 0);
6569  if (__pyx_t_5) {
6570 
6571  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":522
6572  *
6573  * if not B_is_identity:
6574  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6575  * B_is_row_major = 1
6576  * elif B.flags['F_CONTIGUOUS']:
6577  */
6578  __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error))
6579  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
6580  __Pyx_GOTREF(__pyx_t_1);
6581  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
6582  __Pyx_GOTREF(__pyx_t_2);
6583  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6584  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
6585  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6586  if (__pyx_t_5) {
6587 
6588  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":523
6589  * if not B_is_identity:
6590  * if B.flags['C_CONTIGUOUS']:
6591  * B_is_row_major = 1 # <<<<<<<<<<<<<<
6592  * elif B.flags['F_CONTIGUOUS']:
6593  * B_is_row_major = 0
6594  */
6595  __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error))
6596  __pyx_v_B_is_row_major = 1;
6597 
6598  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":522
6599  *
6600  * if not B_is_identity:
6601  * if B.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
6602  * B_is_row_major = 1
6603  * elif B.flags['F_CONTIGUOUS']:
6604  */
6605  goto __pyx_L5;
6606  }
6607 
6608  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":524
6609  * if B.flags['C_CONTIGUOUS']:
6610  * B_is_row_major = 1
6611  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6612  * B_is_row_major = 0
6613  * else:
6614  */
6615  __Pyx_TraceLine(524,0,__PYX_ERR(0, 524, __pyx_L1_error))
6616  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
6617  __Pyx_GOTREF(__pyx_t_2);
6618  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
6619  __Pyx_GOTREF(__pyx_t_1);
6620  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6621  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
6622  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6623  if (likely(__pyx_t_5)) {
6624 
6625  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":525
6626  * B_is_row_major = 1
6627  * elif B.flags['F_CONTIGUOUS']:
6628  * B_is_row_major = 0 # <<<<<<<<<<<<<<
6629  * else:
6630  * raise TypeError('Matrix B should be either C or F contiguous.')
6631  */
6632  __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
6633  __pyx_v_B_is_row_major = 0;
6634 
6635  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":524
6636  * if B.flags['C_CONTIGUOUS']:
6637  * B_is_row_major = 1
6638  * elif B.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
6639  * B_is_row_major = 0
6640  * else:
6641  */
6642  goto __pyx_L5;
6643  }
6644 
6645  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":527
6646  * B_is_row_major = 0
6647  * else:
6648  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
6649  *
6650  * # Declare memoryviews to get data pointer
6651  */
6652  __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error))
6653  /*else*/ {
6654  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
6655  __Pyx_GOTREF(__pyx_t_1);
6656  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6657  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6658  __PYX_ERR(0, 527, __pyx_L1_error)
6659  }
6660  __pyx_L5:;
6661 
6662  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":521
6663  * raise TypeError('Matrix A should be either C or F contiguous.')
6664  *
6665  * if not B_is_identity: # <<<<<<<<<<<<<<
6666  * if B.flags['C_CONTIGUOUS']:
6667  * B_is_row_major = 1
6668  */
6669  }
6670 
6671  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":532
6672  * cdef long double[:, ::1] A_data_mv_c
6673  * cdef long double[::1, :] A_data_mv_f
6674  * cdef long double[:, ::1] B_data_mv_c = None # <<<<<<<<<<<<<<
6675  * cdef long double[::1, :] B_data_mv_f = None
6676  *
6677  */
6678  __Pyx_TraceLine(532,0,__PYX_ERR(0, 532, __pyx_L1_error))
6679  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 532, __pyx_L1_error)
6680  __pyx_v_B_data_mv_c = __pyx_t_6;
6681  __pyx_t_6.memview = NULL;
6682  __pyx_t_6.data = NULL;
6683 
6684  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":533
6685  * cdef long double[::1, :] A_data_mv_f
6686  * cdef long double[:, ::1] B_data_mv_c = None
6687  * cdef long double[::1, :] B_data_mv_f = None # <<<<<<<<<<<<<<
6688  *
6689  * # Declare pointer to A.data and B.data
6690  */
6691  __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error))
6692  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 533, __pyx_L1_error)
6693  __pyx_v_B_data_mv_f = __pyx_t_7;
6694  __pyx_t_7.memview = NULL;
6695  __pyx_t_7.data = NULL;
6696 
6697  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":537
6698  * # Declare pointer to A.data and B.data
6699  * cdef long double* A_data
6700  * cdef long double* B_data = NULL # <<<<<<<<<<<<<<
6701  *
6702  * # Get pointer to data of A depending on row or column major
6703  */
6704  __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error))
6705  __pyx_v_B_data = NULL;
6706 
6707  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":540
6708  *
6709  * # Get pointer to data of A depending on row or column major
6710  * if A_is_row_major: # <<<<<<<<<<<<<<
6711  *
6712  * # Memoryview of A for row major matrix
6713  */
6714  __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6715  __pyx_t_5 = (__pyx_v_A_is_row_major != 0);
6716  if (__pyx_t_5) {
6717 
6718  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":543
6719  *
6720  * # Memoryview of A for row major matrix
6721  * A_data_mv_c = A # <<<<<<<<<<<<<<
6722  *
6723  * # Pointer of the data of A
6724  */
6725  __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6726  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 543, __pyx_L1_error)
6727  __pyx_v_A_data_mv_c = __pyx_t_6;
6728  __pyx_t_6.memview = NULL;
6729  __pyx_t_6.data = NULL;
6730 
6731  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":546
6732  *
6733  * # Pointer of the data of A
6734  * A_data = &A_data_mv_c[0, 0] # <<<<<<<<<<<<<<
6735  *
6736  * else:
6737  */
6738  __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6739  __pyx_t_8 = 0;
6740  __pyx_t_9 = 0;
6741  __pyx_v_A_data = (&(*((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_A_data_mv_c.data + __pyx_t_8 * __pyx_v_A_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6742 
6743  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":540
6744  *
6745  * # Get pointer to data of A depending on row or column major
6746  * if A_is_row_major: # <<<<<<<<<<<<<<
6747  *
6748  * # Memoryview of A for row major matrix
6749  */
6750  goto __pyx_L6;
6751  }
6752 
6753  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":551
6754  *
6755  * # Memoryview of A for column major matrix
6756  * A_data_mv_f = A # <<<<<<<<<<<<<<
6757  *
6758  * # Pointer of the data of A
6759  */
6760  __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6761  /*else*/ {
6762  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 551, __pyx_L1_error)
6763  __pyx_v_A_data_mv_f = __pyx_t_7;
6764  __pyx_t_7.memview = NULL;
6765  __pyx_t_7.data = NULL;
6766 
6767  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":554
6768  *
6769  * # Pointer of the data of A
6770  * A_data = &A_data_mv_f[0, 0] # <<<<<<<<<<<<<<
6771  *
6772  * # Get pointer to data of AB depending on row or column major
6773  */
6774  __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error))
6775  __pyx_t_9 = 0;
6776  __pyx_t_8 = 0;
6777  __pyx_v_A_data = (&(*((long double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((long double *) __pyx_v_A_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_A_data_mv_f.strides[1]) ))));
6778  }
6779  __pyx_L6:;
6780 
6781  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":557
6782  *
6783  * # Get pointer to data of AB depending on row or column major
6784  * if not B_is_identity: # <<<<<<<<<<<<<<
6785  * if B_is_row_major:
6786  *
6787  */
6788  __Pyx_TraceLine(557,0,__PYX_ERR(0, 557, __pyx_L1_error))
6789  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 557, __pyx_L1_error)
6790  __pyx_t_4 = ((!__pyx_t_5) != 0);
6791  if (__pyx_t_4) {
6792 
6793  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":558
6794  * # Get pointer to data of AB depending on row or column major
6795  * if not B_is_identity:
6796  * if B_is_row_major: # <<<<<<<<<<<<<<
6797  *
6798  * # Memoryview of A for row major matrix
6799  */
6800  __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6801  __pyx_t_4 = (__pyx_v_B_is_row_major != 0);
6802  if (__pyx_t_4) {
6803 
6804  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":561
6805  *
6806  * # Memoryview of A for row major matrix
6807  * B_data_mv_c = B # <<<<<<<<<<<<<<
6808  *
6809  * # Pointer of the data of A
6810  */
6811  __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6812  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 561, __pyx_L1_error)
6813  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6814  __pyx_v_B_data_mv_c = __pyx_t_6;
6815  __pyx_t_6.memview = NULL;
6816  __pyx_t_6.data = NULL;
6817 
6818  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":564
6819  *
6820  * # Pointer of the data of A
6821  * B_data = &B_data_mv_c[0, 0] # <<<<<<<<<<<<<<
6822  *
6823  * else:
6824  */
6825  __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error))
6826  __pyx_t_8 = 0;
6827  __pyx_t_9 = 0;
6828  __pyx_v_B_data = (&(*((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_B_data_mv_c.data + __pyx_t_8 * __pyx_v_B_data_mv_c.strides[0]) )) + __pyx_t_9)) ))));
6829 
6830  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":558
6831  * # Get pointer to data of AB depending on row or column major
6832  * if not B_is_identity:
6833  * if B_is_row_major: # <<<<<<<<<<<<<<
6834  *
6835  * # Memoryview of A for row major matrix
6836  */
6837  goto __pyx_L8;
6838  }
6839 
6840  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":569
6841  *
6842  * # Memoryview of A for column major matrix
6843  * B_data_mv_f = B # <<<<<<<<<<<<<<
6844  *
6845  * # Pointer of the data of B
6846  */
6847  __Pyx_TraceLine(569,0,__PYX_ERR(0, 569, __pyx_L1_error))
6848  /*else*/ {
6849  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_B, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 569, __pyx_L1_error)
6850  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6851  __pyx_v_B_data_mv_f = __pyx_t_7;
6852  __pyx_t_7.memview = NULL;
6853  __pyx_t_7.data = NULL;
6854 
6855  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":572
6856  *
6857  * # Pointer of the data of B
6858  * B_data = &B_data_mv_f[0, 0] # <<<<<<<<<<<<<<
6859  *
6860  * # Create a linear operator object
6861  */
6862  __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
6863  __pyx_t_9 = 0;
6864  __pyx_t_8 = 0;
6865  __pyx_v_B_data = (&(*((long double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((long double *) __pyx_v_B_data_mv_f.data) + __pyx_t_9)) ) + __pyx_t_8 * __pyx_v_B_data_mv_f.strides[1]) ))));
6866  }
6867  __pyx_L8:;
6868 
6869  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":557
6870  *
6871  * # Get pointer to data of AB depending on row or column major
6872  * if not B_is_identity: # <<<<<<<<<<<<<<
6873  * if B_is_row_major:
6874  *
6875  */
6876  }
6877 
6878  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":575
6879  *
6880  * # Create a linear operator object
6881  * if B_is_identity: # <<<<<<<<<<<<<<
6882  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double](
6883  * A_data,
6884  */
6885  __Pyx_TraceLine(575,0,__PYX_ERR(0, 575, __pyx_L1_error))
6886  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 575, __pyx_L1_error)
6887  if (__pyx_t_4) {
6888 
6889  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":576
6890  * # Create a linear operator object
6891  * if B_is_identity:
6892  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
6893  * A_data,
6894  * A_is_row_major,
6895  */
6896  __Pyx_TraceLine(576,0,__PYX_ERR(0, 576, __pyx_L1_error))
6897  try {
6898  __pyx_t_10 = new cDenseAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6899  } catch(...) {
6900  __Pyx_CppExn2PyErr();
6901  __PYX_ERR(0, 576, __pyx_L1_error)
6902  }
6903  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
6904 
6905  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":575
6906  *
6907  * # Create a linear operator object
6908  * if B_is_identity: # <<<<<<<<<<<<<<
6909  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double](
6910  * A_data,
6911  */
6912  goto __pyx_L9;
6913  }
6914 
6915  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":582
6916  * A_num_columns)
6917  * else:
6918  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
6919  * A_data,
6920  * A_is_row_major,
6921  */
6922  __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
6923  /*else*/ {
6924 
6925  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":588
6926  * A_num_columns,
6927  * B_data,
6928  * B_is_row_major) # <<<<<<<<<<<<<<
6929  *
6930  * # ====================
6931  */
6932  __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6933  try {
6934  __pyx_t_10 = new cDenseAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_is_row_major, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_is_row_major);
6935  } catch(...) {
6936  __Pyx_CppExn2PyErr();
6937  __PYX_ERR(0, 582, __pyx_L1_error)
6938  }
6939 
6940  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":582
6941  * A_num_columns)
6942  * else:
6943  * self.Aop_long_double = new cDenseAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
6944  * A_data,
6945  * A_is_row_major,
6946  */
6947  __Pyx_TraceLine(582,0,__PYX_ERR(0, 582, __pyx_L1_error))
6948  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_10;
6949  }
6950  __pyx_L9:;
6951 
6952  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
6953  * # ============================
6954  *
6955  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
6956  * """
6957  * Sets matrix A.
6958  */
6959 
6960  /* function exit code */
6961  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6962  goto __pyx_L0;
6963  __pyx_L1_error:;
6964  __Pyx_XDECREF(__pyx_t_1);
6965  __Pyx_XDECREF(__pyx_t_2);
6966  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6967  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
6968  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6969  __pyx_r = NULL;
6970  __pyx_L0:;
6971  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_c, 1);
6972  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv_f, 1);
6973  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_c, 1);
6974  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv_f, 1);
6975  __Pyx_XGIVEREF(__pyx_r);
6976  __Pyx_TraceReturn(__pyx_r, 0);
6977  __Pyx_RefNannyFinishContext();
6978  return __pyx_r;
6979 }
6980 
6981 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
6982  * # ====================
6983  *
6984  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
6985  * """
6986  * """
6987  */
6988 
6989 /* Python wrapper */
6990 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6991 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float[] = "pycAffineMatrixFunction.set_csr_matrix_float(self, A, B, B_is_identity)\n\n ";
6992 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float = {"set_csr_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float};
6993 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6994  PyObject *__pyx_v_A = 0;
6995  PyObject *__pyx_v_B = 0;
6996  PyObject *__pyx_v_B_is_identity = 0;
6997  int __pyx_lineno = 0;
6998  const char *__pyx_filename = NULL;
6999  int __pyx_clineno = 0;
7000  PyObject *__pyx_r = 0;
7001  __Pyx_RefNannyDeclarations
7002  __Pyx_RefNannySetupContext("set_csr_matrix_float (wrapper)", 0);
7003  {
7004  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7005  PyObject* values[3] = {0,0,0};
7006  if (unlikely(__pyx_kwds)) {
7007  Py_ssize_t kw_args;
7008  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7009  switch (pos_args) {
7010  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7011  CYTHON_FALLTHROUGH;
7012  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7013  CYTHON_FALLTHROUGH;
7014  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7015  CYTHON_FALLTHROUGH;
7016  case 0: break;
7017  default: goto __pyx_L5_argtuple_error;
7018  }
7019  kw_args = PyDict_Size(__pyx_kwds);
7020  switch (pos_args) {
7021  case 0:
7022  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7023  else goto __pyx_L5_argtuple_error;
7024  CYTHON_FALLTHROUGH;
7025  case 1:
7026  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7027  else {
7028  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 594, __pyx_L3_error)
7029  }
7030  CYTHON_FALLTHROUGH;
7031  case 2:
7032  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7033  else {
7034  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 594, __pyx_L3_error)
7035  }
7036  }
7037  if (unlikely(kw_args > 0)) {
7038  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csr_matrix_float") < 0)) __PYX_ERR(0, 594, __pyx_L3_error)
7039  }
7040  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7041  goto __pyx_L5_argtuple_error;
7042  } else {
7043  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7044  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7045  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7046  }
7047  __pyx_v_A = values[0];
7048  __pyx_v_B = values[1];
7049  __pyx_v_B_is_identity = values[2];
7050  }
7051  goto __pyx_L4_argument_unpacking_done;
7052  __pyx_L5_argtuple_error:;
7053  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 594, __pyx_L3_error)
7054  __pyx_L3_error:;
7055  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7056  __Pyx_RefNannyFinishContext();
7057  return NULL;
7058  __pyx_L4_argument_unpacking_done:;
7059  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7060 
7061  /* function exit code */
7062  __Pyx_RefNannyFinishContext();
7063  return __pyx_r;
7064 }
7065 
7066 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7067  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
7068  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
7069  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7070  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7071  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7072  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7073  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7074  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7075  float *__pyx_v_A_data;
7076  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
7077  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
7078  float *__pyx_v_B_data;
7079  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
7080  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
7081  PyObject *__pyx_r = NULL;
7082  __Pyx_TraceDeclarations
7083  __Pyx_RefNannyDeclarations
7084  PyObject *__pyx_t_1 = NULL;
7085  PyObject *__pyx_t_2 = NULL;
7086  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
7087  PyObject *__pyx_t_4 = NULL;
7088  PyObject *__pyx_t_5 = NULL;
7089  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
7090  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
7091  int __pyx_t_8;
7092  int __pyx_t_9;
7093  Py_ssize_t __pyx_t_10;
7094  cCSRAffineMatrixFunction<float> *__pyx_t_11;
7095  int __pyx_lineno = 0;
7096  const char *__pyx_filename = NULL;
7097  int __pyx_clineno = 0;
7098  __Pyx_TraceFrameInit(__pyx_codeobj__12)
7099  __Pyx_RefNannySetupContext("set_csr_matrix_float", 0);
7100  __Pyx_TraceCall("set_csr_matrix_float", __pyx_f[0], 594, 0, __PYX_ERR(0, 594, __pyx_L1_error));
7101 
7102  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":599
7103  *
7104  * # Matrix size
7105  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
7106  * cdef LongIndexType A_num_columns = A.shape[1]
7107  *
7108  */
7109  __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
7110  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
7111  __Pyx_GOTREF(__pyx_t_1);
7112  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
7113  __Pyx_GOTREF(__pyx_t_2);
7114  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7115  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error)
7116  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7117  __pyx_v_A_num_rows = __pyx_t_3;
7118 
7119  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":600
7120  * # Matrix size
7121  * cdef LongIndexType A_num_rows = A.shape[0]
7122  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
7123  *
7124  * # If the input type is the same as LongIndexType, no copy is performed.
7125  */
7126  __Pyx_TraceLine(600,0,__PYX_ERR(0, 600, __pyx_L1_error))
7127  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error)
7128  __Pyx_GOTREF(__pyx_t_2);
7129  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
7130  __Pyx_GOTREF(__pyx_t_1);
7131  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7132  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error)
7133  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7134  __pyx_v_A_num_columns = __pyx_t_3;
7135 
7136  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":604
7137  * # If the input type is the same as LongIndexType, no copy is performed.
7138  * self.A_indices_copy = \
7139  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7140  * self.A_index_pointer_copy = \
7141  * A.indptr.astype(self.long_index_type_name, copy=False)
7142  */
7143  __Pyx_TraceLine(604,0,__PYX_ERR(0, 604, __pyx_L1_error))
7144  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7145  __Pyx_GOTREF(__pyx_t_1);
7146  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
7147  __Pyx_GOTREF(__pyx_t_2);
7148  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7149  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7150  __Pyx_GOTREF(__pyx_t_1);
7151  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
7152  __Pyx_GOTREF(__pyx_t_4);
7153  __Pyx_GIVEREF(__pyx_t_1);
7154  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7155  __pyx_t_1 = 0;
7156  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
7157  __Pyx_GOTREF(__pyx_t_1);
7158  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
7159  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error)
7160  __Pyx_GOTREF(__pyx_t_5);
7161  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7162  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7163  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7164 
7165  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":603
7166  *
7167  * # If the input type is the same as LongIndexType, no copy is performed.
7168  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
7169  * A.indices.astype(self.long_index_type_name, copy=False)
7170  * self.A_index_pointer_copy = \
7171  */
7172  __Pyx_TraceLine(603,0,__PYX_ERR(0, 603, __pyx_L1_error))
7173  __Pyx_GIVEREF(__pyx_t_5);
7174  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
7175  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
7176  __pyx_v_self->A_indices_copy = __pyx_t_5;
7177  __pyx_t_5 = 0;
7178 
7179  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":606
7180  * A.indices.astype(self.long_index_type_name, copy=False)
7181  * self.A_index_pointer_copy = \
7182  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7183  *
7184  * # Declare memoryviews to get pointers
7185  */
7186  __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error))
7187  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7188  __Pyx_GOTREF(__pyx_t_5);
7189  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
7190  __Pyx_GOTREF(__pyx_t_1);
7191  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7192  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7193  __Pyx_GOTREF(__pyx_t_5);
7194  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
7195  __Pyx_GOTREF(__pyx_t_4);
7196  __Pyx_GIVEREF(__pyx_t_5);
7197  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7198  __pyx_t_5 = 0;
7199  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
7200  __Pyx_GOTREF(__pyx_t_5);
7201  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
7202  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
7203  __Pyx_GOTREF(__pyx_t_2);
7204  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7205  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7206  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7207 
7208  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":605
7209  * self.A_indices_copy = \
7210  * A.indices.astype(self.long_index_type_name, copy=False)
7211  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
7212  * A.indptr.astype(self.long_index_type_name, copy=False)
7213  *
7214  */
7215  __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
7216  __Pyx_GIVEREF(__pyx_t_2);
7217  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
7218  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
7219  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
7220  __pyx_t_2 = 0;
7221 
7222  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":609
7223  *
7224  * # Declare memoryviews to get pointers
7225  * cdef float[:] A_data_mv = A.data # <<<<<<<<<<<<<<
7226  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
7227  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7228  */
7229  __Pyx_TraceLine(609,0,__PYX_ERR(0, 609, __pyx_L1_error))
7230  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
7231  __Pyx_GOTREF(__pyx_t_2);
7232  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 609, __pyx_L1_error)
7233  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7234  __pyx_v_A_data_mv = __pyx_t_6;
7235  __pyx_t_6.memview = NULL;
7236  __pyx_t_6.data = NULL;
7237 
7238  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":610
7239  * # Declare memoryviews to get pointers
7240  * cdef float[:] A_data_mv = A.data
7241  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
7242  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7243  * self.A_index_pointer_copy
7244  */
7245  __Pyx_TraceLine(610,0,__PYX_ERR(0, 610, __pyx_L1_error))
7246  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 610, __pyx_L1_error)
7247  __pyx_v_A_indices_mv = __pyx_t_7;
7248  __pyx_t_7.memview = NULL;
7249  __pyx_t_7.data = NULL;
7250 
7251  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":612
7252  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
7253  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7254  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
7255  * cdef float[:] B_data_mv = None
7256  * cdef MemoryViewLongIndexType B_indices_mv = None
7257  */
7258  __Pyx_TraceLine(612,0,__PYX_ERR(0, 612, __pyx_L1_error))
7259  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 612, __pyx_L1_error)
7260  __pyx_v_A_index_pointer_mv = __pyx_t_7;
7261  __pyx_t_7.memview = NULL;
7262  __pyx_t_7.data = NULL;
7263 
7264  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":613
7265  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7266  * self.A_index_pointer_copy
7267  * cdef float[:] B_data_mv = None # <<<<<<<<<<<<<<
7268  * cdef MemoryViewLongIndexType B_indices_mv = None
7269  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7270  */
7271  __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error))
7272  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 613, __pyx_L1_error)
7273  __pyx_v_B_data_mv = __pyx_t_6;
7274  __pyx_t_6.memview = NULL;
7275  __pyx_t_6.data = NULL;
7276 
7277  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":614
7278  * self.A_index_pointer_copy
7279  * cdef float[:] B_data_mv = None
7280  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
7281  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7282  *
7283  */
7284  __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error))
7285  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 614, __pyx_L1_error)
7286  __pyx_v_B_indices_mv = __pyx_t_7;
7287  __pyx_t_7.memview = NULL;
7288  __pyx_t_7.data = NULL;
7289 
7290  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":615
7291  * cdef float[:] B_data_mv = None
7292  * cdef MemoryViewLongIndexType B_indices_mv = None
7293  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
7294  *
7295  * if not B_is_identity:
7296  */
7297  __Pyx_TraceLine(615,0,__PYX_ERR(0, 615, __pyx_L1_error))
7298  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 615, __pyx_L1_error)
7299  __pyx_v_B_index_pointer_mv = __pyx_t_7;
7300  __pyx_t_7.memview = NULL;
7301  __pyx_t_7.data = NULL;
7302 
7303  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":617
7304  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7305  *
7306  * if not B_is_identity: # <<<<<<<<<<<<<<
7307  *
7308  * # If input type is the same as LongIndexType, no copy is performed.
7309  */
7310  __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error))
7311  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
7312  __pyx_t_9 = ((!__pyx_t_8) != 0);
7313  if (__pyx_t_9) {
7314 
7315  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":621
7316  * # If input type is the same as LongIndexType, no copy is performed.
7317  * self.B_indices_copy = \
7318  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7319  * self.B_index_pointer_copy = \
7320  * B.indptr.astype(self.long_index_type_name, copy=False)
7321  */
7322  __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error))
7323  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7324  __Pyx_GOTREF(__pyx_t_2);
7325  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
7326  __Pyx_GOTREF(__pyx_t_5);
7327  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7328  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7329  __Pyx_GOTREF(__pyx_t_2);
7330  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
7331  __Pyx_GOTREF(__pyx_t_4);
7332  __Pyx_GIVEREF(__pyx_t_2);
7333  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7334  __pyx_t_2 = 0;
7335  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error)
7336  __Pyx_GOTREF(__pyx_t_2);
7337  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
7338  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
7339  __Pyx_GOTREF(__pyx_t_1);
7340  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7341  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7342  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7343 
7344  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":620
7345  *
7346  * # If input type is the same as LongIndexType, no copy is performed.
7347  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
7348  * B.indices.astype(self.long_index_type_name, copy=False)
7349  * self.B_index_pointer_copy = \
7350  */
7351  __Pyx_TraceLine(620,0,__PYX_ERR(0, 620, __pyx_L1_error))
7352  __Pyx_GIVEREF(__pyx_t_1);
7353  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
7354  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
7355  __pyx_v_self->B_indices_copy = __pyx_t_1;
7356  __pyx_t_1 = 0;
7357 
7358  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":623
7359  * B.indices.astype(self.long_index_type_name, copy=False)
7360  * self.B_index_pointer_copy = \
7361  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7362  *
7363  * B_data_mv = B.data
7364  */
7365  __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error))
7366  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7367  __Pyx_GOTREF(__pyx_t_1);
7368  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
7369  __Pyx_GOTREF(__pyx_t_2);
7370  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7371  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7372  __Pyx_GOTREF(__pyx_t_1);
7373  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
7374  __Pyx_GOTREF(__pyx_t_4);
7375  __Pyx_GIVEREF(__pyx_t_1);
7376  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7377  __pyx_t_1 = 0;
7378  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
7379  __Pyx_GOTREF(__pyx_t_1);
7380  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
7381  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
7382  __Pyx_GOTREF(__pyx_t_5);
7383  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7384  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7385  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7386 
7387  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":622
7388  * self.B_indices_copy = \
7389  * B.indices.astype(self.long_index_type_name, copy=False)
7390  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
7391  * B.indptr.astype(self.long_index_type_name, copy=False)
7392  *
7393  */
7394  __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error))
7395  __Pyx_GIVEREF(__pyx_t_5);
7396  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
7397  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
7398  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
7399  __pyx_t_5 = 0;
7400 
7401  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":625
7402  * B.indptr.astype(self.long_index_type_name, copy=False)
7403  *
7404  * B_data_mv = B.data # <<<<<<<<<<<<<<
7405  * B_indices_mv = self.B_indices_copy
7406  * B_index_pointer_mv = self.B_index_pointer_copy
7407  */
7408  __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
7409  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error)
7410  __Pyx_GOTREF(__pyx_t_5);
7411  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 625, __pyx_L1_error)
7412  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7413  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7414  __pyx_v_B_data_mv = __pyx_t_6;
7415  __pyx_t_6.memview = NULL;
7416  __pyx_t_6.data = NULL;
7417 
7418  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":626
7419  *
7420  * B_data_mv = B.data
7421  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
7422  * B_index_pointer_mv = self.B_index_pointer_copy
7423  *
7424  */
7425  __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error))
7426  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 626, __pyx_L1_error)
7427  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7428  __pyx_v_B_indices_mv = __pyx_t_7;
7429  __pyx_t_7.memview = NULL;
7430  __pyx_t_7.data = NULL;
7431 
7432  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":627
7433  * B_data_mv = B.data
7434  * B_indices_mv = self.B_indices_copy
7435  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
7436  *
7437  * # Declare pointers
7438  */
7439  __Pyx_TraceLine(627,0,__PYX_ERR(0, 627, __pyx_L1_error))
7440  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 627, __pyx_L1_error)
7441  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7442  __pyx_v_B_index_pointer_mv = __pyx_t_7;
7443  __pyx_t_7.memview = NULL;
7444  __pyx_t_7.data = NULL;
7445 
7446  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":617
7447  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7448  *
7449  * if not B_is_identity: # <<<<<<<<<<<<<<
7450  *
7451  * # If input type is the same as LongIndexType, no copy is performed.
7452  */
7453  }
7454 
7455  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":630
7456  *
7457  * # Declare pointers
7458  * cdef float* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
7459  * cdef LongIndexType* A_indices = &A_indices_mv[0]
7460  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7461  */
7462  __Pyx_TraceLine(630,0,__PYX_ERR(0, 630, __pyx_L1_error))
7463  __pyx_t_10 = 0;
7464  __pyx_v_A_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
7465 
7466  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":631
7467  * # Declare pointers
7468  * cdef float* A_data = &A_data_mv[0]
7469  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
7470  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7471  * cdef float* B_data = NULL
7472  */
7473  __Pyx_TraceLine(631,0,__PYX_ERR(0, 631, __pyx_L1_error))
7474  __pyx_t_10 = 0;
7475  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
7476 
7477  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":632
7478  * cdef float* A_data = &A_data_mv[0]
7479  * cdef LongIndexType* A_indices = &A_indices_mv[0]
7480  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
7481  * cdef float* B_data = NULL
7482  * cdef LongIndexType* B_indices = NULL
7483  */
7484  __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error))
7485  __pyx_t_10 = 0;
7486  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
7487 
7488  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":633
7489  * cdef LongIndexType* A_indices = &A_indices_mv[0]
7490  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7491  * cdef float* B_data = NULL # <<<<<<<<<<<<<<
7492  * cdef LongIndexType* B_indices = NULL
7493  * cdef LongIndexType* B_index_pointer = NULL
7494  */
7495  __Pyx_TraceLine(633,0,__PYX_ERR(0, 633, __pyx_L1_error))
7496  __pyx_v_B_data = NULL;
7497 
7498  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":634
7499  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
7500  * cdef float* B_data = NULL
7501  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
7502  * cdef LongIndexType* B_index_pointer = NULL
7503  *
7504  */
7505  __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
7506  __pyx_v_B_indices = NULL;
7507 
7508  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":635
7509  * cdef float* B_data = NULL
7510  * cdef LongIndexType* B_indices = NULL
7511  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
7512  *
7513  * if not B_is_identity:
7514  */
7515  __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
7516  __pyx_v_B_index_pointer = NULL;
7517 
7518  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":637
7519  * cdef LongIndexType* B_index_pointer = NULL
7520  *
7521  * if not B_is_identity: # <<<<<<<<<<<<<<
7522  * B_data = &B_data_mv[0]
7523  * B_indices = &B_indices_mv[0]
7524  */
7525  __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
7526  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
7527  __pyx_t_8 = ((!__pyx_t_9) != 0);
7528  if (__pyx_t_8) {
7529 
7530  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":638
7531  *
7532  * if not B_is_identity:
7533  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
7534  * B_indices = &B_indices_mv[0]
7535  * B_index_pointer = &B_index_pointer_mv[0]
7536  */
7537  __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error))
7538  __pyx_t_10 = 0;
7539  __pyx_v_B_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
7540 
7541  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":639
7542  * if not B_is_identity:
7543  * B_data = &B_data_mv[0]
7544  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
7545  * B_index_pointer = &B_index_pointer_mv[0]
7546  *
7547  */
7548  __Pyx_TraceLine(639,0,__PYX_ERR(0, 639, __pyx_L1_error))
7549  __pyx_t_10 = 0;
7550  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
7551 
7552  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":640
7553  * B_data = &B_data_mv[0]
7554  * B_indices = &B_indices_mv[0]
7555  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
7556  *
7557  * # Create a linear operator object
7558  */
7559  __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
7560  __pyx_t_10 = 0;
7561  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
7562 
7563  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":637
7564  * cdef LongIndexType* B_index_pointer = NULL
7565  *
7566  * if not B_is_identity: # <<<<<<<<<<<<<<
7567  * B_data = &B_data_mv[0]
7568  * B_indices = &B_indices_mv[0]
7569  */
7570  }
7571 
7572  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":643
7573  *
7574  * # Create a linear operator object
7575  * if B_is_identity: # <<<<<<<<<<<<<<
7576  * self.Aop_float = new cCSRAffineMatrixFunction[float](
7577  * A_data,
7578  */
7579  __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error))
7580  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
7581  if (__pyx_t_8) {
7582 
7583  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":644
7584  * # Create a linear operator object
7585  * if B_is_identity:
7586  * self.Aop_float = new cCSRAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
7587  * A_data,
7588  * A_indices,
7589  */
7590  __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error))
7591  try {
7592  __pyx_t_11 = new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
7593  } catch(...) {
7594  __Pyx_CppExn2PyErr();
7595  __PYX_ERR(0, 644, __pyx_L1_error)
7596  }
7597  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7598 
7599  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":643
7600  *
7601  * # Create a linear operator object
7602  * if B_is_identity: # <<<<<<<<<<<<<<
7603  * self.Aop_float = new cCSRAffineMatrixFunction[float](
7604  * A_data,
7605  */
7606  goto __pyx_L5;
7607  }
7608 
7609  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":651
7610  * A_num_columns)
7611  * else:
7612  * self.Aop_float = new cCSRAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
7613  * A_data,
7614  * A_indices,
7615  */
7616  __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7617  /*else*/ {
7618 
7619  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":659
7620  * B_data,
7621  * B_indices,
7622  * B_index_pointer) # <<<<<<<<<<<<<<
7623  *
7624  * # =====================
7625  */
7626  __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error))
7627  try {
7628  __pyx_t_11 = new cCSRAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
7629  } catch(...) {
7630  __Pyx_CppExn2PyErr();
7631  __PYX_ERR(0, 651, __pyx_L1_error)
7632  }
7633 
7634  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":651
7635  * A_num_columns)
7636  * else:
7637  * self.Aop_float = new cCSRAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
7638  * A_data,
7639  * A_indices,
7640  */
7641  __Pyx_TraceLine(651,0,__PYX_ERR(0, 651, __pyx_L1_error))
7642  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
7643  }
7644  __pyx_L5:;
7645 
7646  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
7647  * # ====================
7648  *
7649  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
7650  * """
7651  * """
7652  */
7653 
7654  /* function exit code */
7655  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7656  goto __pyx_L0;
7657  __pyx_L1_error:;
7658  __Pyx_XDECREF(__pyx_t_1);
7659  __Pyx_XDECREF(__pyx_t_2);
7660  __Pyx_XDECREF(__pyx_t_4);
7661  __Pyx_XDECREF(__pyx_t_5);
7662  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7663  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
7664  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
7665  __pyx_r = NULL;
7666  __pyx_L0:;
7667  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
7668  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
7669  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
7670  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
7671  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
7672  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
7673  __Pyx_XGIVEREF(__pyx_r);
7674  __Pyx_TraceReturn(__pyx_r, 0);
7675  __Pyx_RefNannyFinishContext();
7676  return __pyx_r;
7677 }
7678 
7679 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
7680  * # =====================
7681  *
7682  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
7683  * """
7684  * """
7685  */
7686 
7687 /* Python wrapper */
7688 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7689 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double[] = "pycAffineMatrixFunction.set_csr_matrix_double(self, A, B, B_is_identity)\n\n ";
7690 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double = {"set_csr_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double};
7691 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7692  PyObject *__pyx_v_A = 0;
7693  PyObject *__pyx_v_B = 0;
7694  PyObject *__pyx_v_B_is_identity = 0;
7695  int __pyx_lineno = 0;
7696  const char *__pyx_filename = NULL;
7697  int __pyx_clineno = 0;
7698  PyObject *__pyx_r = 0;
7699  __Pyx_RefNannyDeclarations
7700  __Pyx_RefNannySetupContext("set_csr_matrix_double (wrapper)", 0);
7701  {
7702  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
7703  PyObject* values[3] = {0,0,0};
7704  if (unlikely(__pyx_kwds)) {
7705  Py_ssize_t kw_args;
7706  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7707  switch (pos_args) {
7708  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7709  CYTHON_FALLTHROUGH;
7710  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7711  CYTHON_FALLTHROUGH;
7712  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7713  CYTHON_FALLTHROUGH;
7714  case 0: break;
7715  default: goto __pyx_L5_argtuple_error;
7716  }
7717  kw_args = PyDict_Size(__pyx_kwds);
7718  switch (pos_args) {
7719  case 0:
7720  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
7721  else goto __pyx_L5_argtuple_error;
7722  CYTHON_FALLTHROUGH;
7723  case 1:
7724  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
7725  else {
7726  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 665, __pyx_L3_error)
7727  }
7728  CYTHON_FALLTHROUGH;
7729  case 2:
7730  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
7731  else {
7732  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 665, __pyx_L3_error)
7733  }
7734  }
7735  if (unlikely(kw_args > 0)) {
7736  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csr_matrix_double") < 0)) __PYX_ERR(0, 665, __pyx_L3_error)
7737  }
7738  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7739  goto __pyx_L5_argtuple_error;
7740  } else {
7741  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7742  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7743  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7744  }
7745  __pyx_v_A = values[0];
7746  __pyx_v_B = values[1];
7747  __pyx_v_B_is_identity = values[2];
7748  }
7749  goto __pyx_L4_argument_unpacking_done;
7750  __pyx_L5_argtuple_error:;
7751  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 665, __pyx_L3_error)
7752  __pyx_L3_error:;
7753  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7754  __Pyx_RefNannyFinishContext();
7755  return NULL;
7756  __pyx_L4_argument_unpacking_done:;
7757  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
7758 
7759  /* function exit code */
7760  __Pyx_RefNannyFinishContext();
7761  return __pyx_r;
7762 }
7763 
7764 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
7765  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
7766  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
7767  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7768  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7769  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7770  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7771  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7772  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
7773  double *__pyx_v_A_data;
7774  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
7775  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
7776  double *__pyx_v_B_data;
7777  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
7778  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
7779  PyObject *__pyx_r = NULL;
7780  __Pyx_TraceDeclarations
7781  __Pyx_RefNannyDeclarations
7782  PyObject *__pyx_t_1 = NULL;
7783  PyObject *__pyx_t_2 = NULL;
7784  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
7785  PyObject *__pyx_t_4 = NULL;
7786  PyObject *__pyx_t_5 = NULL;
7787  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
7788  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
7789  int __pyx_t_8;
7790  int __pyx_t_9;
7791  Py_ssize_t __pyx_t_10;
7793  int __pyx_lineno = 0;
7794  const char *__pyx_filename = NULL;
7795  int __pyx_clineno = 0;
7796  __Pyx_TraceFrameInit(__pyx_codeobj__13)
7797  __Pyx_RefNannySetupContext("set_csr_matrix_double", 0);
7798  __Pyx_TraceCall("set_csr_matrix_double", __pyx_f[0], 665, 0, __PYX_ERR(0, 665, __pyx_L1_error));
7799 
7800  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":670
7801  *
7802  * # Matrix size
7803  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
7804  * cdef LongIndexType A_num_columns = A.shape[1]
7805  *
7806  */
7807  __Pyx_TraceLine(670,0,__PYX_ERR(0, 670, __pyx_L1_error))
7808  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
7809  __Pyx_GOTREF(__pyx_t_1);
7810  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
7811  __Pyx_GOTREF(__pyx_t_2);
7812  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7813  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L1_error)
7814  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7815  __pyx_v_A_num_rows = __pyx_t_3;
7816 
7817  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":671
7818  * # Matrix size
7819  * cdef LongIndexType A_num_rows = A.shape[0]
7820  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
7821  *
7822  * # If the input type is the same as LongIndexType, no copy is performed.
7823  */
7824  __Pyx_TraceLine(671,0,__PYX_ERR(0, 671, __pyx_L1_error))
7825  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
7826  __Pyx_GOTREF(__pyx_t_2);
7827  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
7828  __Pyx_GOTREF(__pyx_t_1);
7829  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7830  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L1_error)
7831  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7832  __pyx_v_A_num_columns = __pyx_t_3;
7833 
7834  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":675
7835  * # If the input type is the same as LongIndexType, no copy is performed.
7836  * self.A_indices_copy = \
7837  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7838  * self.A_index_pointer_copy = \
7839  * A.indptr.astype(self.long_index_type_name, copy=False)
7840  */
7841  __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error))
7842  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
7843  __Pyx_GOTREF(__pyx_t_1);
7844  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
7845  __Pyx_GOTREF(__pyx_t_2);
7846  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7847  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
7848  __Pyx_GOTREF(__pyx_t_1);
7849  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
7850  __Pyx_GOTREF(__pyx_t_4);
7851  __Pyx_GIVEREF(__pyx_t_1);
7852  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7853  __pyx_t_1 = 0;
7854  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
7855  __Pyx_GOTREF(__pyx_t_1);
7856  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
7857  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error)
7858  __Pyx_GOTREF(__pyx_t_5);
7859  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7860  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7861  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7862 
7863  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":674
7864  *
7865  * # If the input type is the same as LongIndexType, no copy is performed.
7866  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
7867  * A.indices.astype(self.long_index_type_name, copy=False)
7868  * self.A_index_pointer_copy = \
7869  */
7870  __Pyx_TraceLine(674,0,__PYX_ERR(0, 674, __pyx_L1_error))
7871  __Pyx_GIVEREF(__pyx_t_5);
7872  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
7873  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
7874  __pyx_v_self->A_indices_copy = __pyx_t_5;
7875  __pyx_t_5 = 0;
7876 
7877  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":677
7878  * A.indices.astype(self.long_index_type_name, copy=False)
7879  * self.A_index_pointer_copy = \
7880  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
7881  *
7882  * # Declare memoryviews to get pointers
7883  */
7884  __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L1_error))
7885  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
7886  __Pyx_GOTREF(__pyx_t_5);
7887  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
7888  __Pyx_GOTREF(__pyx_t_1);
7889  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7890  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
7891  __Pyx_GOTREF(__pyx_t_5);
7892  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
7893  __Pyx_GOTREF(__pyx_t_4);
7894  __Pyx_GIVEREF(__pyx_t_5);
7895  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7896  __pyx_t_5 = 0;
7897  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
7898  __Pyx_GOTREF(__pyx_t_5);
7899  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 677, __pyx_L1_error)
7900  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
7901  __Pyx_GOTREF(__pyx_t_2);
7902  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7903  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7904  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7905 
7906  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":676
7907  * self.A_indices_copy = \
7908  * A.indices.astype(self.long_index_type_name, copy=False)
7909  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
7910  * A.indptr.astype(self.long_index_type_name, copy=False)
7911  *
7912  */
7913  __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error))
7914  __Pyx_GIVEREF(__pyx_t_2);
7915  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
7916  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
7917  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
7918  __pyx_t_2 = 0;
7919 
7920  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":680
7921  *
7922  * # Declare memoryviews to get pointers
7923  * cdef double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
7924  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
7925  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7926  */
7927  __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error))
7928  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
7929  __Pyx_GOTREF(__pyx_t_2);
7930  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 680, __pyx_L1_error)
7931  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7932  __pyx_v_A_data_mv = __pyx_t_6;
7933  __pyx_t_6.memview = NULL;
7934  __pyx_t_6.data = NULL;
7935 
7936  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":681
7937  * # Declare memoryviews to get pointers
7938  * cdef double[:] A_data_mv = A.data
7939  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
7940  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7941  * self.A_index_pointer_copy
7942  */
7943  __Pyx_TraceLine(681,0,__PYX_ERR(0, 681, __pyx_L1_error))
7944  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 681, __pyx_L1_error)
7945  __pyx_v_A_indices_mv = __pyx_t_7;
7946  __pyx_t_7.memview = NULL;
7947  __pyx_t_7.data = NULL;
7948 
7949  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":683
7950  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
7951  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7952  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
7953  * cdef double[:] B_data_mv = None
7954  * cdef MemoryViewLongIndexType B_indices_mv = None
7955  */
7956  __Pyx_TraceLine(683,0,__PYX_ERR(0, 683, __pyx_L1_error))
7957  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 683, __pyx_L1_error)
7958  __pyx_v_A_index_pointer_mv = __pyx_t_7;
7959  __pyx_t_7.memview = NULL;
7960  __pyx_t_7.data = NULL;
7961 
7962  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":684
7963  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
7964  * self.A_index_pointer_copy
7965  * cdef double[:] B_data_mv = None # <<<<<<<<<<<<<<
7966  * cdef MemoryViewLongIndexType B_indices_mv = None
7967  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7968  */
7969  __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error))
7970  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 684, __pyx_L1_error)
7971  __pyx_v_B_data_mv = __pyx_t_6;
7972  __pyx_t_6.memview = NULL;
7973  __pyx_t_6.data = NULL;
7974 
7975  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":685
7976  * self.A_index_pointer_copy
7977  * cdef double[:] B_data_mv = None
7978  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
7979  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
7980  *
7981  */
7982  __Pyx_TraceLine(685,0,__PYX_ERR(0, 685, __pyx_L1_error))
7983  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 685, __pyx_L1_error)
7984  __pyx_v_B_indices_mv = __pyx_t_7;
7985  __pyx_t_7.memview = NULL;
7986  __pyx_t_7.data = NULL;
7987 
7988  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":686
7989  * cdef double[:] B_data_mv = None
7990  * cdef MemoryViewLongIndexType B_indices_mv = None
7991  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
7992  *
7993  * if not B_is_identity:
7994  */
7995  __Pyx_TraceLine(686,0,__PYX_ERR(0, 686, __pyx_L1_error))
7996  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
7997  __pyx_v_B_index_pointer_mv = __pyx_t_7;
7998  __pyx_t_7.memview = NULL;
7999  __pyx_t_7.data = NULL;
8000 
8001  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":688
8002  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8003  *
8004  * if not B_is_identity: # <<<<<<<<<<<<<<
8005  *
8006  * # If input type is the same as LongIndexType, no copy is performed.
8007  */
8008  __Pyx_TraceLine(688,0,__PYX_ERR(0, 688, __pyx_L1_error))
8009  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
8010  __pyx_t_9 = ((!__pyx_t_8) != 0);
8011  if (__pyx_t_9) {
8012 
8013  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":692
8014  * # If input type is the same as LongIndexType, no copy is performed.
8015  * self.B_indices_copy = \
8016  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8017  * self.B_index_pointer_copy = \
8018  * B.indptr.astype(self.long_index_type_name, copy=False)
8019  */
8020  __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L1_error))
8021  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8022  __Pyx_GOTREF(__pyx_t_2);
8023  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
8024  __Pyx_GOTREF(__pyx_t_5);
8025  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8026  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8027  __Pyx_GOTREF(__pyx_t_2);
8028  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
8029  __Pyx_GOTREF(__pyx_t_4);
8030  __Pyx_GIVEREF(__pyx_t_2);
8031  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8032  __pyx_t_2 = 0;
8033  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
8034  __Pyx_GOTREF(__pyx_t_2);
8035  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
8036  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
8037  __Pyx_GOTREF(__pyx_t_1);
8038  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8039  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8040  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8041 
8042  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":691
8043  *
8044  * # If input type is the same as LongIndexType, no copy is performed.
8045  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
8046  * B.indices.astype(self.long_index_type_name, copy=False)
8047  * self.B_index_pointer_copy = \
8048  */
8049  __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L1_error))
8050  __Pyx_GIVEREF(__pyx_t_1);
8051  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8052  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8053  __pyx_v_self->B_indices_copy = __pyx_t_1;
8054  __pyx_t_1 = 0;
8055 
8056  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":694
8057  * B.indices.astype(self.long_index_type_name, copy=False)
8058  * self.B_index_pointer_copy = \
8059  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8060  *
8061  * B_data_mv = B.data
8062  */
8063  __Pyx_TraceLine(694,0,__PYX_ERR(0, 694, __pyx_L1_error))
8064  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8065  __Pyx_GOTREF(__pyx_t_1);
8066  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
8067  __Pyx_GOTREF(__pyx_t_2);
8068  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8069  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8070  __Pyx_GOTREF(__pyx_t_1);
8071  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
8072  __Pyx_GOTREF(__pyx_t_4);
8073  __Pyx_GIVEREF(__pyx_t_1);
8074  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8075  __pyx_t_1 = 0;
8076  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
8077  __Pyx_GOTREF(__pyx_t_1);
8078  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
8079  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
8080  __Pyx_GOTREF(__pyx_t_5);
8081  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8082  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8083  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8084 
8085  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":693
8086  * self.B_indices_copy = \
8087  * B.indices.astype(self.long_index_type_name, copy=False)
8088  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
8089  * B.indptr.astype(self.long_index_type_name, copy=False)
8090  *
8091  */
8092  __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L1_error))
8093  __Pyx_GIVEREF(__pyx_t_5);
8094  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
8095  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
8096  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
8097  __pyx_t_5 = 0;
8098 
8099  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":696
8100  * B.indptr.astype(self.long_index_type_name, copy=False)
8101  *
8102  * B_data_mv = B.data # <<<<<<<<<<<<<<
8103  * B_indices_mv = self.B_indices_copy
8104  * B_index_pointer_mv = self.B_index_pointer_copy
8105  */
8106  __Pyx_TraceLine(696,0,__PYX_ERR(0, 696, __pyx_L1_error))
8107  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
8108  __Pyx_GOTREF(__pyx_t_5);
8109  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 696, __pyx_L1_error)
8110  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8111  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8112  __pyx_v_B_data_mv = __pyx_t_6;
8113  __pyx_t_6.memview = NULL;
8114  __pyx_t_6.data = NULL;
8115 
8116  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":697
8117  *
8118  * B_data_mv = B.data
8119  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
8120  * B_index_pointer_mv = self.B_index_pointer_copy
8121  *
8122  */
8123  __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error))
8124  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 697, __pyx_L1_error)
8125  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8126  __pyx_v_B_indices_mv = __pyx_t_7;
8127  __pyx_t_7.memview = NULL;
8128  __pyx_t_7.data = NULL;
8129 
8130  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":698
8131  * B_data_mv = B.data
8132  * B_indices_mv = self.B_indices_copy
8133  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
8134  *
8135  * # Declare pointers
8136  */
8137  __Pyx_TraceLine(698,0,__PYX_ERR(0, 698, __pyx_L1_error))
8138  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 698, __pyx_L1_error)
8139  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8140  __pyx_v_B_index_pointer_mv = __pyx_t_7;
8141  __pyx_t_7.memview = NULL;
8142  __pyx_t_7.data = NULL;
8143 
8144  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":688
8145  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8146  *
8147  * if not B_is_identity: # <<<<<<<<<<<<<<
8148  *
8149  * # If input type is the same as LongIndexType, no copy is performed.
8150  */
8151  }
8152 
8153  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":701
8154  *
8155  * # Declare pointers
8156  * cdef double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
8157  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8158  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8159  */
8160  __Pyx_TraceLine(701,0,__PYX_ERR(0, 701, __pyx_L1_error))
8161  __pyx_t_10 = 0;
8162  __pyx_v_A_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
8163 
8164  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":702
8165  * # Declare pointers
8166  * cdef double* A_data = &A_data_mv[0]
8167  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
8168  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8169  * cdef double* B_data = NULL
8170  */
8171  __Pyx_TraceLine(702,0,__PYX_ERR(0, 702, __pyx_L1_error))
8172  __pyx_t_10 = 0;
8173  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
8174 
8175  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":703
8176  * cdef double* A_data = &A_data_mv[0]
8177  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8178  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
8179  * cdef double* B_data = NULL
8180  * cdef LongIndexType* B_indices = NULL
8181  */
8182  __Pyx_TraceLine(703,0,__PYX_ERR(0, 703, __pyx_L1_error))
8183  __pyx_t_10 = 0;
8184  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
8185 
8186  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":704
8187  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8188  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8189  * cdef double* B_data = NULL # <<<<<<<<<<<<<<
8190  * cdef LongIndexType* B_indices = NULL
8191  * cdef LongIndexType* B_index_pointer = NULL
8192  */
8193  __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L1_error))
8194  __pyx_v_B_data = NULL;
8195 
8196  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":705
8197  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8198  * cdef double* B_data = NULL
8199  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
8200  * cdef LongIndexType* B_index_pointer = NULL
8201  *
8202  */
8203  __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error))
8204  __pyx_v_B_indices = NULL;
8205 
8206  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":706
8207  * cdef double* B_data = NULL
8208  * cdef LongIndexType* B_indices = NULL
8209  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
8210  *
8211  * if not B_is_identity:
8212  */
8213  __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L1_error))
8214  __pyx_v_B_index_pointer = NULL;
8215 
8216  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":708
8217  * cdef LongIndexType* B_index_pointer = NULL
8218  *
8219  * if not B_is_identity: # <<<<<<<<<<<<<<
8220  * B_data = &B_data_mv[0]
8221  * B_indices = &B_indices_mv[0]
8222  */
8223  __Pyx_TraceLine(708,0,__PYX_ERR(0, 708, __pyx_L1_error))
8224  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
8225  __pyx_t_8 = ((!__pyx_t_9) != 0);
8226  if (__pyx_t_8) {
8227 
8228  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":709
8229  *
8230  * if not B_is_identity:
8231  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
8232  * B_indices = &B_indices_mv[0]
8233  * B_index_pointer = &B_index_pointer_mv[0]
8234  */
8235  __Pyx_TraceLine(709,0,__PYX_ERR(0, 709, __pyx_L1_error))
8236  __pyx_t_10 = 0;
8237  __pyx_v_B_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
8238 
8239  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":710
8240  * if not B_is_identity:
8241  * B_data = &B_data_mv[0]
8242  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
8243  * B_index_pointer = &B_index_pointer_mv[0]
8244  *
8245  */
8246  __Pyx_TraceLine(710,0,__PYX_ERR(0, 710, __pyx_L1_error))
8247  __pyx_t_10 = 0;
8248  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
8249 
8250  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":711
8251  * B_data = &B_data_mv[0]
8252  * B_indices = &B_indices_mv[0]
8253  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
8254  *
8255  * # Create a linear operator object
8256  */
8257  __Pyx_TraceLine(711,0,__PYX_ERR(0, 711, __pyx_L1_error))
8258  __pyx_t_10 = 0;
8259  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
8260 
8261  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":708
8262  * cdef LongIndexType* B_index_pointer = NULL
8263  *
8264  * if not B_is_identity: # <<<<<<<<<<<<<<
8265  * B_data = &B_data_mv[0]
8266  * B_indices = &B_indices_mv[0]
8267  */
8268  }
8269 
8270  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":714
8271  *
8272  * # Create a linear operator object
8273  * if B_is_identity: # <<<<<<<<<<<<<<
8274  * self.Aop_double = new cCSRAffineMatrixFunction[double](
8275  * A_data,
8276  */
8277  __Pyx_TraceLine(714,0,__PYX_ERR(0, 714, __pyx_L1_error))
8278  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
8279  if (__pyx_t_8) {
8280 
8281  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":715
8282  * # Create a linear operator object
8283  * if B_is_identity:
8284  * self.Aop_double = new cCSRAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
8285  * A_data,
8286  * A_indices,
8287  */
8288  __Pyx_TraceLine(715,0,__PYX_ERR(0, 715, __pyx_L1_error))
8289  try {
8290  __pyx_t_11 = new cCSRAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
8291  } catch(...) {
8292  __Pyx_CppExn2PyErr();
8293  __PYX_ERR(0, 715, __pyx_L1_error)
8294  }
8295  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8296 
8297  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":714
8298  *
8299  * # Create a linear operator object
8300  * if B_is_identity: # <<<<<<<<<<<<<<
8301  * self.Aop_double = new cCSRAffineMatrixFunction[double](
8302  * A_data,
8303  */
8304  goto __pyx_L5;
8305  }
8306 
8307  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":722
8308  * A_num_columns)
8309  * else:
8310  * self.Aop_double = new cCSRAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
8311  * A_data,
8312  * A_indices,
8313  */
8314  __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8315  /*else*/ {
8316 
8317  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":730
8318  * B_data,
8319  * B_indices,
8320  * B_index_pointer) # <<<<<<<<<<<<<<
8321  *
8322  * # ==========================
8323  */
8324  __Pyx_TraceLine(730,0,__PYX_ERR(0, 730, __pyx_L1_error))
8325  try {
8326  __pyx_t_11 = new cCSRAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
8327  } catch(...) {
8328  __Pyx_CppExn2PyErr();
8329  __PYX_ERR(0, 722, __pyx_L1_error)
8330  }
8331 
8332  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":722
8333  * A_num_columns)
8334  * else:
8335  * self.Aop_double = new cCSRAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
8336  * A_data,
8337  * A_indices,
8338  */
8339  __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
8340  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
8341  }
8342  __pyx_L5:;
8343 
8344  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
8345  * # =====================
8346  *
8347  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
8348  * """
8349  * """
8350  */
8351 
8352  /* function exit code */
8353  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8354  goto __pyx_L0;
8355  __pyx_L1_error:;
8356  __Pyx_XDECREF(__pyx_t_1);
8357  __Pyx_XDECREF(__pyx_t_2);
8358  __Pyx_XDECREF(__pyx_t_4);
8359  __Pyx_XDECREF(__pyx_t_5);
8360  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
8361  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
8362  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8363  __pyx_r = NULL;
8364  __pyx_L0:;
8365  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
8366  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
8367  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
8368  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8369  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8370  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8371  __Pyx_XGIVEREF(__pyx_r);
8372  __Pyx_TraceReturn(__pyx_r, 0);
8373  __Pyx_RefNannyFinishContext();
8374  return __pyx_r;
8375 }
8376 
8377 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
8378  * # ==========================
8379  *
8380  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
8381  * """
8382  * """
8383  */
8384 
8385 /* Python wrapper */
8386 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8387 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double[] = "pycAffineMatrixFunction.set_csr_matrix_long_double(self, A, B, B_is_identity)\n\n ";
8388 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double = {"set_csr_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double};
8389 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8390  PyObject *__pyx_v_A = 0;
8391  PyObject *__pyx_v_B = 0;
8392  PyObject *__pyx_v_B_is_identity = 0;
8393  int __pyx_lineno = 0;
8394  const char *__pyx_filename = NULL;
8395  int __pyx_clineno = 0;
8396  PyObject *__pyx_r = 0;
8397  __Pyx_RefNannyDeclarations
8398  __Pyx_RefNannySetupContext("set_csr_matrix_long_double (wrapper)", 0);
8399  {
8400  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
8401  PyObject* values[3] = {0,0,0};
8402  if (unlikely(__pyx_kwds)) {
8403  Py_ssize_t kw_args;
8404  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8405  switch (pos_args) {
8406  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8407  CYTHON_FALLTHROUGH;
8408  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8409  CYTHON_FALLTHROUGH;
8410  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8411  CYTHON_FALLTHROUGH;
8412  case 0: break;
8413  default: goto __pyx_L5_argtuple_error;
8414  }
8415  kw_args = PyDict_Size(__pyx_kwds);
8416  switch (pos_args) {
8417  case 0:
8418  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
8419  else goto __pyx_L5_argtuple_error;
8420  CYTHON_FALLTHROUGH;
8421  case 1:
8422  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
8423  else {
8424  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 736, __pyx_L3_error)
8425  }
8426  CYTHON_FALLTHROUGH;
8427  case 2:
8428  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
8429  else {
8430  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 736, __pyx_L3_error)
8431  }
8432  }
8433  if (unlikely(kw_args > 0)) {
8434  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csr_matrix_long_double") < 0)) __PYX_ERR(0, 736, __pyx_L3_error)
8435  }
8436  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
8437  goto __pyx_L5_argtuple_error;
8438  } else {
8439  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8440  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8441  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8442  }
8443  __pyx_v_A = values[0];
8444  __pyx_v_B = values[1];
8445  __pyx_v_B_is_identity = values[2];
8446  }
8447  goto __pyx_L4_argument_unpacking_done;
8448  __pyx_L5_argtuple_error:;
8449  __Pyx_RaiseArgtupleInvalid("set_csr_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 736, __pyx_L3_error)
8450  __pyx_L3_error:;
8451  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8452  __Pyx_RefNannyFinishContext();
8453  return NULL;
8454  __pyx_L4_argument_unpacking_done:;
8455  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
8456 
8457  /* function exit code */
8458  __Pyx_RefNannyFinishContext();
8459  return __pyx_r;
8460 }
8461 
8462 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
8463  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
8464  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
8465  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8466  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8467  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8468  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8469  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8470  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
8471  long double *__pyx_v_A_data;
8472  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
8473  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
8474  long double *__pyx_v_B_data;
8475  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
8476  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
8477  PyObject *__pyx_r = NULL;
8478  __Pyx_TraceDeclarations
8479  __Pyx_RefNannyDeclarations
8480  PyObject *__pyx_t_1 = NULL;
8481  PyObject *__pyx_t_2 = NULL;
8482  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
8483  PyObject *__pyx_t_4 = NULL;
8484  PyObject *__pyx_t_5 = NULL;
8485  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
8486  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
8487  int __pyx_t_8;
8488  int __pyx_t_9;
8489  Py_ssize_t __pyx_t_10;
8491  int __pyx_lineno = 0;
8492  const char *__pyx_filename = NULL;
8493  int __pyx_clineno = 0;
8494  __Pyx_TraceFrameInit(__pyx_codeobj__14)
8495  __Pyx_RefNannySetupContext("set_csr_matrix_long_double", 0);
8496  __Pyx_TraceCall("set_csr_matrix_long_double", __pyx_f[0], 736, 0, __PYX_ERR(0, 736, __pyx_L1_error));
8497 
8498  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":741
8499  *
8500  * # Matrix size
8501  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
8502  * cdef LongIndexType A_num_columns = A.shape[1]
8503  *
8504  */
8505  __Pyx_TraceLine(741,0,__PYX_ERR(0, 741, __pyx_L1_error))
8506  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
8507  __Pyx_GOTREF(__pyx_t_1);
8508  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
8509  __Pyx_GOTREF(__pyx_t_2);
8510  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8511  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L1_error)
8512  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8513  __pyx_v_A_num_rows = __pyx_t_3;
8514 
8515  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":742
8516  * # Matrix size
8517  * cdef LongIndexType A_num_rows = A.shape[0]
8518  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
8519  *
8520  * # If the input type is the same as LongIndexType, no copy is performed.
8521  */
8522  __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L1_error))
8523  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
8524  __Pyx_GOTREF(__pyx_t_2);
8525  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
8526  __Pyx_GOTREF(__pyx_t_1);
8527  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8528  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L1_error)
8529  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8530  __pyx_v_A_num_columns = __pyx_t_3;
8531 
8532  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":746
8533  * # If the input type is the same as LongIndexType, no copy is performed.
8534  * self.A_indices_copy = \
8535  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8536  * self.A_index_pointer_copy = \
8537  * A.indptr.astype(self.long_index_type_name, copy=False)
8538  */
8539  __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L1_error))
8540  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8541  __Pyx_GOTREF(__pyx_t_1);
8542  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
8543  __Pyx_GOTREF(__pyx_t_2);
8544  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8545  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8546  __Pyx_GOTREF(__pyx_t_1);
8547  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
8548  __Pyx_GOTREF(__pyx_t_4);
8549  __Pyx_GIVEREF(__pyx_t_1);
8550  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8551  __pyx_t_1 = 0;
8552  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
8553  __Pyx_GOTREF(__pyx_t_1);
8554  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
8555  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
8556  __Pyx_GOTREF(__pyx_t_5);
8557  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8558  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8559  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8560 
8561  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":745
8562  *
8563  * # If the input type is the same as LongIndexType, no copy is performed.
8564  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
8565  * A.indices.astype(self.long_index_type_name, copy=False)
8566  * self.A_index_pointer_copy = \
8567  */
8568  __Pyx_TraceLine(745,0,__PYX_ERR(0, 745, __pyx_L1_error))
8569  __Pyx_GIVEREF(__pyx_t_5);
8570  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
8571  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
8572  __pyx_v_self->A_indices_copy = __pyx_t_5;
8573  __pyx_t_5 = 0;
8574 
8575  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":748
8576  * A.indices.astype(self.long_index_type_name, copy=False)
8577  * self.A_index_pointer_copy = \
8578  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8579  *
8580  * # Declare memoryviews to get pointers
8581  */
8582  __Pyx_TraceLine(748,0,__PYX_ERR(0, 748, __pyx_L1_error))
8583  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8584  __Pyx_GOTREF(__pyx_t_5);
8585  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
8586  __Pyx_GOTREF(__pyx_t_1);
8587  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8588  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8589  __Pyx_GOTREF(__pyx_t_5);
8590  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
8591  __Pyx_GOTREF(__pyx_t_4);
8592  __Pyx_GIVEREF(__pyx_t_5);
8593  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8594  __pyx_t_5 = 0;
8595  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
8596  __Pyx_GOTREF(__pyx_t_5);
8597  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
8598  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
8599  __Pyx_GOTREF(__pyx_t_2);
8600  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8601  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8602  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8603 
8604  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":747
8605  * self.A_indices_copy = \
8606  * A.indices.astype(self.long_index_type_name, copy=False)
8607  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
8608  * A.indptr.astype(self.long_index_type_name, copy=False)
8609  *
8610  */
8611  __Pyx_TraceLine(747,0,__PYX_ERR(0, 747, __pyx_L1_error))
8612  __Pyx_GIVEREF(__pyx_t_2);
8613  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
8614  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
8615  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
8616  __pyx_t_2 = 0;
8617 
8618  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":751
8619  *
8620  * # Declare memoryviews to get pointers
8621  * cdef long double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
8622  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
8623  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8624  */
8625  __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L1_error))
8626  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
8627  __Pyx_GOTREF(__pyx_t_2);
8628  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 751, __pyx_L1_error)
8629  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8630  __pyx_v_A_data_mv = __pyx_t_6;
8631  __pyx_t_6.memview = NULL;
8632  __pyx_t_6.data = NULL;
8633 
8634  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":752
8635  * # Declare memoryviews to get pointers
8636  * cdef long double[:] A_data_mv = A.data
8637  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
8638  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8639  * self.A_index_pointer_copy
8640  */
8641  __Pyx_TraceLine(752,0,__PYX_ERR(0, 752, __pyx_L1_error))
8642  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 752, __pyx_L1_error)
8643  __pyx_v_A_indices_mv = __pyx_t_7;
8644  __pyx_t_7.memview = NULL;
8645  __pyx_t_7.data = NULL;
8646 
8647  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":754
8648  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
8649  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8650  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
8651  * cdef long double[:] B_data_mv = None
8652  * cdef MemoryViewLongIndexType B_indices_mv = None
8653  */
8654  __Pyx_TraceLine(754,0,__PYX_ERR(0, 754, __pyx_L1_error))
8655  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 754, __pyx_L1_error)
8656  __pyx_v_A_index_pointer_mv = __pyx_t_7;
8657  __pyx_t_7.memview = NULL;
8658  __pyx_t_7.data = NULL;
8659 
8660  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":755
8661  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
8662  * self.A_index_pointer_copy
8663  * cdef long double[:] B_data_mv = None # <<<<<<<<<<<<<<
8664  * cdef MemoryViewLongIndexType B_indices_mv = None
8665  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8666  */
8667  __Pyx_TraceLine(755,0,__PYX_ERR(0, 755, __pyx_L1_error))
8668  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 755, __pyx_L1_error)
8669  __pyx_v_B_data_mv = __pyx_t_6;
8670  __pyx_t_6.memview = NULL;
8671  __pyx_t_6.data = NULL;
8672 
8673  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":756
8674  * self.A_index_pointer_copy
8675  * cdef long double[:] B_data_mv = None
8676  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
8677  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8678  *
8679  */
8680  __Pyx_TraceLine(756,0,__PYX_ERR(0, 756, __pyx_L1_error))
8681  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 756, __pyx_L1_error)
8682  __pyx_v_B_indices_mv = __pyx_t_7;
8683  __pyx_t_7.memview = NULL;
8684  __pyx_t_7.data = NULL;
8685 
8686  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":757
8687  * cdef long double[:] B_data_mv = None
8688  * cdef MemoryViewLongIndexType B_indices_mv = None
8689  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
8690  *
8691  * if not B_is_identity:
8692  */
8693  __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
8694  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 757, __pyx_L1_error)
8695  __pyx_v_B_index_pointer_mv = __pyx_t_7;
8696  __pyx_t_7.memview = NULL;
8697  __pyx_t_7.data = NULL;
8698 
8699  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":759
8700  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8701  *
8702  * if not B_is_identity: # <<<<<<<<<<<<<<
8703  *
8704  * # If input type is the same as LongIndexType, no copy is performed.
8705  */
8706  __Pyx_TraceLine(759,0,__PYX_ERR(0, 759, __pyx_L1_error))
8707  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 759, __pyx_L1_error)
8708  __pyx_t_9 = ((!__pyx_t_8) != 0);
8709  if (__pyx_t_9) {
8710 
8711  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":763
8712  * # If input type is the same as LongIndexType, no copy is performed.
8713  * self.B_indices_copy = \
8714  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8715  * self.B_index_pointer_copy = \
8716  * B.indptr.astype(self.long_index_type_name, copy=False)
8717  */
8718  __Pyx_TraceLine(763,0,__PYX_ERR(0, 763, __pyx_L1_error))
8719  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8720  __Pyx_GOTREF(__pyx_t_2);
8721  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
8722  __Pyx_GOTREF(__pyx_t_5);
8723  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8724  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8725  __Pyx_GOTREF(__pyx_t_2);
8726  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
8727  __Pyx_GOTREF(__pyx_t_4);
8728  __Pyx_GIVEREF(__pyx_t_2);
8729  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8730  __pyx_t_2 = 0;
8731  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
8732  __Pyx_GOTREF(__pyx_t_2);
8733  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 763, __pyx_L1_error)
8734  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
8735  __Pyx_GOTREF(__pyx_t_1);
8736  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8737  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8738  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8739 
8740  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":762
8741  *
8742  * # If input type is the same as LongIndexType, no copy is performed.
8743  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
8744  * B.indices.astype(self.long_index_type_name, copy=False)
8745  * self.B_index_pointer_copy = \
8746  */
8747  __Pyx_TraceLine(762,0,__PYX_ERR(0, 762, __pyx_L1_error))
8748  __Pyx_GIVEREF(__pyx_t_1);
8749  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
8750  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
8751  __pyx_v_self->B_indices_copy = __pyx_t_1;
8752  __pyx_t_1 = 0;
8753 
8754  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":765
8755  * B.indices.astype(self.long_index_type_name, copy=False)
8756  * self.B_index_pointer_copy = \
8757  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
8758  *
8759  * B_data_mv = B.data
8760  */
8761  __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L1_error))
8762  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8763  __Pyx_GOTREF(__pyx_t_1);
8764  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
8765  __Pyx_GOTREF(__pyx_t_2);
8766  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8767  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8768  __Pyx_GOTREF(__pyx_t_1);
8769  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
8770  __Pyx_GOTREF(__pyx_t_4);
8771  __Pyx_GIVEREF(__pyx_t_1);
8772  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8773  __pyx_t_1 = 0;
8774  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
8775  __Pyx_GOTREF(__pyx_t_1);
8776  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
8777  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __pyx_L1_error)
8778  __Pyx_GOTREF(__pyx_t_5);
8779  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8780  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8781  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8782 
8783  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":764
8784  * self.B_indices_copy = \
8785  * B.indices.astype(self.long_index_type_name, copy=False)
8786  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
8787  * B.indptr.astype(self.long_index_type_name, copy=False)
8788  *
8789  */
8790  __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L1_error))
8791  __Pyx_GIVEREF(__pyx_t_5);
8792  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
8793  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
8794  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
8795  __pyx_t_5 = 0;
8796 
8797  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":767
8798  * B.indptr.astype(self.long_index_type_name, copy=False)
8799  *
8800  * B_data_mv = B.data # <<<<<<<<<<<<<<
8801  * B_indices_mv = self.B_indices_copy
8802  * B_index_pointer_mv = self.B_index_pointer_copy
8803  */
8804  __Pyx_TraceLine(767,0,__PYX_ERR(0, 767, __pyx_L1_error))
8805  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
8806  __Pyx_GOTREF(__pyx_t_5);
8807  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 767, __pyx_L1_error)
8808  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8809  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
8810  __pyx_v_B_data_mv = __pyx_t_6;
8811  __pyx_t_6.memview = NULL;
8812  __pyx_t_6.data = NULL;
8813 
8814  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":768
8815  *
8816  * B_data_mv = B.data
8817  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
8818  * B_index_pointer_mv = self.B_index_pointer_copy
8819  *
8820  */
8821  __Pyx_TraceLine(768,0,__PYX_ERR(0, 768, __pyx_L1_error))
8822  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 768, __pyx_L1_error)
8823  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
8824  __pyx_v_B_indices_mv = __pyx_t_7;
8825  __pyx_t_7.memview = NULL;
8826  __pyx_t_7.data = NULL;
8827 
8828  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":769
8829  * B_data_mv = B.data
8830  * B_indices_mv = self.B_indices_copy
8831  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
8832  *
8833  * # Declare pointers
8834  */
8835  __Pyx_TraceLine(769,0,__PYX_ERR(0, 769, __pyx_L1_error))
8836  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 769, __pyx_L1_error)
8837  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
8838  __pyx_v_B_index_pointer_mv = __pyx_t_7;
8839  __pyx_t_7.memview = NULL;
8840  __pyx_t_7.data = NULL;
8841 
8842  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":759
8843  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
8844  *
8845  * if not B_is_identity: # <<<<<<<<<<<<<<
8846  *
8847  * # If input type is the same as LongIndexType, no copy is performed.
8848  */
8849  }
8850 
8851  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":772
8852  *
8853  * # Declare pointers
8854  * cdef long double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
8855  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8856  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8857  */
8858  __Pyx_TraceLine(772,0,__PYX_ERR(0, 772, __pyx_L1_error))
8859  __pyx_t_10 = 0;
8860  __pyx_v_A_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
8861 
8862  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":773
8863  * # Declare pointers
8864  * cdef long double* A_data = &A_data_mv[0]
8865  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
8866  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8867  * cdef long double* B_data = NULL
8868  */
8869  __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L1_error))
8870  __pyx_t_10 = 0;
8871  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
8872 
8873  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":774
8874  * cdef long double* A_data = &A_data_mv[0]
8875  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8876  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
8877  * cdef long double* B_data = NULL
8878  * cdef LongIndexType* B_indices = NULL
8879  */
8880  __Pyx_TraceLine(774,0,__PYX_ERR(0, 774, __pyx_L1_error))
8881  __pyx_t_10 = 0;
8882  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
8883 
8884  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":775
8885  * cdef LongIndexType* A_indices = &A_indices_mv[0]
8886  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8887  * cdef long double* B_data = NULL # <<<<<<<<<<<<<<
8888  * cdef LongIndexType* B_indices = NULL
8889  * cdef LongIndexType* B_index_pointer = NULL
8890  */
8891  __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L1_error))
8892  __pyx_v_B_data = NULL;
8893 
8894  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":776
8895  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
8896  * cdef long double* B_data = NULL
8897  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
8898  * cdef LongIndexType* B_index_pointer = NULL
8899  *
8900  */
8901  __Pyx_TraceLine(776,0,__PYX_ERR(0, 776, __pyx_L1_error))
8902  __pyx_v_B_indices = NULL;
8903 
8904  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":777
8905  * cdef long double* B_data = NULL
8906  * cdef LongIndexType* B_indices = NULL
8907  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
8908  *
8909  * if not B_is_identity:
8910  */
8911  __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L1_error))
8912  __pyx_v_B_index_pointer = NULL;
8913 
8914  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":779
8915  * cdef LongIndexType* B_index_pointer = NULL
8916  *
8917  * if not B_is_identity: # <<<<<<<<<<<<<<
8918  * B_data = &B_data_mv[0]
8919  * B_indices = &B_indices_mv[0]
8920  */
8921  __Pyx_TraceLine(779,0,__PYX_ERR(0, 779, __pyx_L1_error))
8922  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 779, __pyx_L1_error)
8923  __pyx_t_8 = ((!__pyx_t_9) != 0);
8924  if (__pyx_t_8) {
8925 
8926  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":780
8927  *
8928  * if not B_is_identity:
8929  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
8930  * B_indices = &B_indices_mv[0]
8931  * B_index_pointer = &B_index_pointer_mv[0]
8932  */
8933  __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
8934  __pyx_t_10 = 0;
8935  __pyx_v_B_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
8936 
8937  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":781
8938  * if not B_is_identity:
8939  * B_data = &B_data_mv[0]
8940  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
8941  * B_index_pointer = &B_index_pointer_mv[0]
8942  *
8943  */
8944  __Pyx_TraceLine(781,0,__PYX_ERR(0, 781, __pyx_L1_error))
8945  __pyx_t_10 = 0;
8946  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
8947 
8948  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":782
8949  * B_data = &B_data_mv[0]
8950  * B_indices = &B_indices_mv[0]
8951  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
8952  *
8953  * # Create a linear operator object
8954  */
8955  __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L1_error))
8956  __pyx_t_10 = 0;
8957  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
8958 
8959  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":779
8960  * cdef LongIndexType* B_index_pointer = NULL
8961  *
8962  * if not B_is_identity: # <<<<<<<<<<<<<<
8963  * B_data = &B_data_mv[0]
8964  * B_indices = &B_indices_mv[0]
8965  */
8966  }
8967 
8968  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":785
8969  *
8970  * # Create a linear operator object
8971  * if B_is_identity: # <<<<<<<<<<<<<<
8972  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double](
8973  * A_data,
8974  */
8975  __Pyx_TraceLine(785,0,__PYX_ERR(0, 785, __pyx_L1_error))
8976  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
8977  if (__pyx_t_8) {
8978 
8979  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":786
8980  * # Create a linear operator object
8981  * if B_is_identity:
8982  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
8983  * A_data,
8984  * A_indices,
8985  */
8986  __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L1_error))
8987  try {
8988  __pyx_t_11 = new cCSRAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
8989  } catch(...) {
8990  __Pyx_CppExn2PyErr();
8991  __PYX_ERR(0, 786, __pyx_L1_error)
8992  }
8993  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
8994 
8995  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":785
8996  *
8997  * # Create a linear operator object
8998  * if B_is_identity: # <<<<<<<<<<<<<<
8999  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double](
9000  * A_data,
9001  */
9002  goto __pyx_L5;
9003  }
9004 
9005  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":793
9006  * A_num_columns)
9007  * else:
9008  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
9009  * A_data,
9010  * A_indices,
9011  */
9012  __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9013  /*else*/ {
9014 
9015  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":801
9016  * B_data,
9017  * B_indices,
9018  * B_index_pointer) # <<<<<<<<<<<<<<
9019  *
9020  * # ====================
9021  */
9022  __Pyx_TraceLine(801,0,__PYX_ERR(0, 801, __pyx_L1_error))
9023  try {
9024  __pyx_t_11 = new cCSRAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9025  } catch(...) {
9026  __Pyx_CppExn2PyErr();
9027  __PYX_ERR(0, 793, __pyx_L1_error)
9028  }
9029 
9030  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":793
9031  * A_num_columns)
9032  * else:
9033  * self.Aop_long_double = new cCSRAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
9034  * A_data,
9035  * A_indices,
9036  */
9037  __Pyx_TraceLine(793,0,__PYX_ERR(0, 793, __pyx_L1_error))
9038  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
9039  }
9040  __pyx_L5:;
9041 
9042  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
9043  * # ==========================
9044  *
9045  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9046  * """
9047  * """
9048  */
9049 
9050  /* function exit code */
9051  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9052  goto __pyx_L0;
9053  __pyx_L1_error:;
9054  __Pyx_XDECREF(__pyx_t_1);
9055  __Pyx_XDECREF(__pyx_t_2);
9056  __Pyx_XDECREF(__pyx_t_4);
9057  __Pyx_XDECREF(__pyx_t_5);
9058  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9059  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9060  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
9061  __pyx_r = NULL;
9062  __pyx_L0:;
9063  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9064  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9065  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9066  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9067  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9068  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9069  __Pyx_XGIVEREF(__pyx_r);
9070  __Pyx_TraceReturn(__pyx_r, 0);
9071  __Pyx_RefNannyFinishContext();
9072  return __pyx_r;
9073 }
9074 
9075 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
9076  * # ====================
9077  *
9078  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9079  * """
9080  * """
9081  */
9082 
9083 /* Python wrapper */
9084 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9085 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float[] = "pycAffineMatrixFunction.set_csc_matrix_float(self, A, B, B_is_identity)\n\n ";
9086 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float = {"set_csc_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float};
9087 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9088  PyObject *__pyx_v_A = 0;
9089  PyObject *__pyx_v_B = 0;
9090  PyObject *__pyx_v_B_is_identity = 0;
9091  int __pyx_lineno = 0;
9092  const char *__pyx_filename = NULL;
9093  int __pyx_clineno = 0;
9094  PyObject *__pyx_r = 0;
9095  __Pyx_RefNannyDeclarations
9096  __Pyx_RefNannySetupContext("set_csc_matrix_float (wrapper)", 0);
9097  {
9098  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
9099  PyObject* values[3] = {0,0,0};
9100  if (unlikely(__pyx_kwds)) {
9101  Py_ssize_t kw_args;
9102  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9103  switch (pos_args) {
9104  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9105  CYTHON_FALLTHROUGH;
9106  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9107  CYTHON_FALLTHROUGH;
9108  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9109  CYTHON_FALLTHROUGH;
9110  case 0: break;
9111  default: goto __pyx_L5_argtuple_error;
9112  }
9113  kw_args = PyDict_Size(__pyx_kwds);
9114  switch (pos_args) {
9115  case 0:
9116  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
9117  else goto __pyx_L5_argtuple_error;
9118  CYTHON_FALLTHROUGH;
9119  case 1:
9120  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
9121  else {
9122  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_float", 1, 3, 3, 1); __PYX_ERR(0, 807, __pyx_L3_error)
9123  }
9124  CYTHON_FALLTHROUGH;
9125  case 2:
9126  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
9127  else {
9128  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_float", 1, 3, 3, 2); __PYX_ERR(0, 807, __pyx_L3_error)
9129  }
9130  }
9131  if (unlikely(kw_args > 0)) {
9132  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csc_matrix_float") < 0)) __PYX_ERR(0, 807, __pyx_L3_error)
9133  }
9134  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9135  goto __pyx_L5_argtuple_error;
9136  } else {
9137  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9138  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9139  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9140  }
9141  __pyx_v_A = values[0];
9142  __pyx_v_B = values[1];
9143  __pyx_v_B_is_identity = values[2];
9144  }
9145  goto __pyx_L4_argument_unpacking_done;
9146  __pyx_L5_argtuple_error:;
9147  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_float", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 807, __pyx_L3_error)
9148  __pyx_L3_error:;
9149  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9150  __Pyx_RefNannyFinishContext();
9151  return NULL;
9152  __pyx_L4_argument_unpacking_done:;
9153  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
9154 
9155  /* function exit code */
9156  __Pyx_RefNannyFinishContext();
9157  return __pyx_r;
9158 }
9159 
9160 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
9161  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
9162  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
9163  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9164  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9165  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9166  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9167  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9168  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9169  float *__pyx_v_A_data;
9170  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
9171  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
9172  float *__pyx_v_B_data;
9173  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
9174  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
9175  PyObject *__pyx_r = NULL;
9176  __Pyx_TraceDeclarations
9177  __Pyx_RefNannyDeclarations
9178  PyObject *__pyx_t_1 = NULL;
9179  PyObject *__pyx_t_2 = NULL;
9180  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
9181  PyObject *__pyx_t_4 = NULL;
9182  PyObject *__pyx_t_5 = NULL;
9183  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
9184  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
9185  int __pyx_t_8;
9186  int __pyx_t_9;
9187  Py_ssize_t __pyx_t_10;
9188  cCSCAffineMatrixFunction<float> *__pyx_t_11;
9189  int __pyx_lineno = 0;
9190  const char *__pyx_filename = NULL;
9191  int __pyx_clineno = 0;
9192  __Pyx_TraceFrameInit(__pyx_codeobj__15)
9193  __Pyx_RefNannySetupContext("set_csc_matrix_float", 0);
9194  __Pyx_TraceCall("set_csc_matrix_float", __pyx_f[0], 807, 0, __PYX_ERR(0, 807, __pyx_L1_error));
9195 
9196  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":812
9197  *
9198  * # Matrix size
9199  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
9200  * cdef LongIndexType A_num_columns = A.shape[1]
9201  *
9202  */
9203  __Pyx_TraceLine(812,0,__PYX_ERR(0, 812, __pyx_L1_error))
9204  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error)
9205  __Pyx_GOTREF(__pyx_t_1);
9206  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error)
9207  __Pyx_GOTREF(__pyx_t_2);
9208  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9209  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 812, __pyx_L1_error)
9210  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9211  __pyx_v_A_num_rows = __pyx_t_3;
9212 
9213  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":813
9214  * # Matrix size
9215  * cdef LongIndexType A_num_rows = A.shape[0]
9216  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
9217  *
9218  * # If the input type is the same as LongIndexType, no copy is performed.
9219  */
9220  __Pyx_TraceLine(813,0,__PYX_ERR(0, 813, __pyx_L1_error))
9221  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error)
9222  __Pyx_GOTREF(__pyx_t_2);
9223  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
9224  __Pyx_GOTREF(__pyx_t_1);
9225  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9226  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 813, __pyx_L1_error)
9227  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9228  __pyx_v_A_num_columns = __pyx_t_3;
9229 
9230  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":817
9231  * # If the input type is the same as LongIndexType, no copy is performed.
9232  * self.A_indices_copy = \
9233  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9234  * self.A_index_pointer_copy = \
9235  * A.indptr.astype(self.long_index_type_name, copy=False)
9236  */
9237  __Pyx_TraceLine(817,0,__PYX_ERR(0, 817, __pyx_L1_error))
9238  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9239  __Pyx_GOTREF(__pyx_t_1);
9240  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
9241  __Pyx_GOTREF(__pyx_t_2);
9242  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9243  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9244  __Pyx_GOTREF(__pyx_t_1);
9245  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
9246  __Pyx_GOTREF(__pyx_t_4);
9247  __Pyx_GIVEREF(__pyx_t_1);
9248  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9249  __pyx_t_1 = 0;
9250  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
9251  __Pyx_GOTREF(__pyx_t_1);
9252  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
9253  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
9254  __Pyx_GOTREF(__pyx_t_5);
9255  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9256  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9257  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9258 
9259  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":816
9260  *
9261  * # If the input type is the same as LongIndexType, no copy is performed.
9262  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
9263  * A.indices.astype(self.long_index_type_name, copy=False)
9264  * self.A_index_pointer_copy = \
9265  */
9266  __Pyx_TraceLine(816,0,__PYX_ERR(0, 816, __pyx_L1_error))
9267  __Pyx_GIVEREF(__pyx_t_5);
9268  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
9269  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
9270  __pyx_v_self->A_indices_copy = __pyx_t_5;
9271  __pyx_t_5 = 0;
9272 
9273  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":819
9274  * A.indices.astype(self.long_index_type_name, copy=False)
9275  * self.A_index_pointer_copy = \
9276  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9277  *
9278  * # Declare memoryviews to get pointers
9279  */
9280  __Pyx_TraceLine(819,0,__PYX_ERR(0, 819, __pyx_L1_error))
9281  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9282  __Pyx_GOTREF(__pyx_t_5);
9283  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
9284  __Pyx_GOTREF(__pyx_t_1);
9285  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9286  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9287  __Pyx_GOTREF(__pyx_t_5);
9288  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error)
9289  __Pyx_GOTREF(__pyx_t_4);
9290  __Pyx_GIVEREF(__pyx_t_5);
9291  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9292  __pyx_t_5 = 0;
9293  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
9294  __Pyx_GOTREF(__pyx_t_5);
9295  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 819, __pyx_L1_error)
9296  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
9297  __Pyx_GOTREF(__pyx_t_2);
9298  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9299  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9300  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9301 
9302  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":818
9303  * self.A_indices_copy = \
9304  * A.indices.astype(self.long_index_type_name, copy=False)
9305  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
9306  * A.indptr.astype(self.long_index_type_name, copy=False)
9307  *
9308  */
9309  __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L1_error))
9310  __Pyx_GIVEREF(__pyx_t_2);
9311  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
9312  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
9313  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
9314  __pyx_t_2 = 0;
9315 
9316  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":822
9317  *
9318  * # Declare memoryviews to get pointers
9319  * cdef float[:] A_data_mv = A.data # <<<<<<<<<<<<<<
9320  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
9321  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9322  */
9323  __Pyx_TraceLine(822,0,__PYX_ERR(0, 822, __pyx_L1_error))
9324  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error)
9325  __Pyx_GOTREF(__pyx_t_2);
9326  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 822, __pyx_L1_error)
9327  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9328  __pyx_v_A_data_mv = __pyx_t_6;
9329  __pyx_t_6.memview = NULL;
9330  __pyx_t_6.data = NULL;
9331 
9332  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":823
9333  * # Declare memoryviews to get pointers
9334  * cdef float[:] A_data_mv = A.data
9335  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
9336  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9337  * self.A_index_pointer_copy
9338  */
9339  __Pyx_TraceLine(823,0,__PYX_ERR(0, 823, __pyx_L1_error))
9340  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 823, __pyx_L1_error)
9341  __pyx_v_A_indices_mv = __pyx_t_7;
9342  __pyx_t_7.memview = NULL;
9343  __pyx_t_7.data = NULL;
9344 
9345  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":825
9346  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
9347  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9348  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
9349  * cdef float[:] B_data_mv = None
9350  * cdef MemoryViewLongIndexType B_indices_mv = None
9351  */
9352  __Pyx_TraceLine(825,0,__PYX_ERR(0, 825, __pyx_L1_error))
9353  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 825, __pyx_L1_error)
9354  __pyx_v_A_index_pointer_mv = __pyx_t_7;
9355  __pyx_t_7.memview = NULL;
9356  __pyx_t_7.data = NULL;
9357 
9358  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":826
9359  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
9360  * self.A_index_pointer_copy
9361  * cdef float[:] B_data_mv = None # <<<<<<<<<<<<<<
9362  * cdef MemoryViewLongIndexType B_indices_mv = None
9363  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9364  */
9365  __Pyx_TraceLine(826,0,__PYX_ERR(0, 826, __pyx_L1_error))
9366  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 826, __pyx_L1_error)
9367  __pyx_v_B_data_mv = __pyx_t_6;
9368  __pyx_t_6.memview = NULL;
9369  __pyx_t_6.data = NULL;
9370 
9371  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":827
9372  * self.A_index_pointer_copy
9373  * cdef float[:] B_data_mv = None
9374  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
9375  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9376  *
9377  */
9378  __Pyx_TraceLine(827,0,__PYX_ERR(0, 827, __pyx_L1_error))
9379  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 827, __pyx_L1_error)
9380  __pyx_v_B_indices_mv = __pyx_t_7;
9381  __pyx_t_7.memview = NULL;
9382  __pyx_t_7.data = NULL;
9383 
9384  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":828
9385  * cdef float[:] B_data_mv = None
9386  * cdef MemoryViewLongIndexType B_indices_mv = None
9387  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
9388  *
9389  * if not B_is_identity:
9390  */
9391  __Pyx_TraceLine(828,0,__PYX_ERR(0, 828, __pyx_L1_error))
9392  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 828, __pyx_L1_error)
9393  __pyx_v_B_index_pointer_mv = __pyx_t_7;
9394  __pyx_t_7.memview = NULL;
9395  __pyx_t_7.data = NULL;
9396 
9397  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":830
9398  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9399  *
9400  * if not B_is_identity: # <<<<<<<<<<<<<<
9401  *
9402  * # If input type is the same as LongIndexType, no copy is performed.
9403  */
9404  __Pyx_TraceLine(830,0,__PYX_ERR(0, 830, __pyx_L1_error))
9405  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
9406  __pyx_t_9 = ((!__pyx_t_8) != 0);
9407  if (__pyx_t_9) {
9408 
9409  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":834
9410  * # If input type is the same as LongIndexType, no copy is performed.
9411  * self.B_indices_copy = \
9412  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9413  * self.B_index_pointer_copy = \
9414  * B.indptr.astype(self.long_index_type_name, copy=False)
9415  */
9416  __Pyx_TraceLine(834,0,__PYX_ERR(0, 834, __pyx_L1_error))
9417  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9418  __Pyx_GOTREF(__pyx_t_2);
9419  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error)
9420  __Pyx_GOTREF(__pyx_t_5);
9421  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9422  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9423  __Pyx_GOTREF(__pyx_t_2);
9424  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
9425  __Pyx_GOTREF(__pyx_t_4);
9426  __Pyx_GIVEREF(__pyx_t_2);
9427  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9428  __pyx_t_2 = 0;
9429  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
9430  __Pyx_GOTREF(__pyx_t_2);
9431  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
9432  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
9433  __Pyx_GOTREF(__pyx_t_1);
9434  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9435  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9436  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9437 
9438  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":833
9439  *
9440  * # If input type is the same as LongIndexType, no copy is performed.
9441  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
9442  * B.indices.astype(self.long_index_type_name, copy=False)
9443  * self.B_index_pointer_copy = \
9444  */
9445  __Pyx_TraceLine(833,0,__PYX_ERR(0, 833, __pyx_L1_error))
9446  __Pyx_GIVEREF(__pyx_t_1);
9447  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
9448  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
9449  __pyx_v_self->B_indices_copy = __pyx_t_1;
9450  __pyx_t_1 = 0;
9451 
9452  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":836
9453  * B.indices.astype(self.long_index_type_name, copy=False)
9454  * self.B_index_pointer_copy = \
9455  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9456  *
9457  * B_data_mv = B.data
9458  */
9459  __Pyx_TraceLine(836,0,__PYX_ERR(0, 836, __pyx_L1_error))
9460  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9461  __Pyx_GOTREF(__pyx_t_1);
9462  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error)
9463  __Pyx_GOTREF(__pyx_t_2);
9464  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9465  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9466  __Pyx_GOTREF(__pyx_t_1);
9467  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error)
9468  __Pyx_GOTREF(__pyx_t_4);
9469  __Pyx_GIVEREF(__pyx_t_1);
9470  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9471  __pyx_t_1 = 0;
9472  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
9473  __Pyx_GOTREF(__pyx_t_1);
9474  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
9475  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
9476  __Pyx_GOTREF(__pyx_t_5);
9477  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9478  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9479  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9480 
9481  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":835
9482  * self.B_indices_copy = \
9483  * B.indices.astype(self.long_index_type_name, copy=False)
9484  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
9485  * B.indptr.astype(self.long_index_type_name, copy=False)
9486  *
9487  */
9488  __Pyx_TraceLine(835,0,__PYX_ERR(0, 835, __pyx_L1_error))
9489  __Pyx_GIVEREF(__pyx_t_5);
9490  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
9491  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
9492  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
9493  __pyx_t_5 = 0;
9494 
9495  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":838
9496  * B.indptr.astype(self.long_index_type_name, copy=False)
9497  *
9498  * B_data_mv = B.data # <<<<<<<<<<<<<<
9499  * B_indices_mv = self.B_indices_copy
9500  * B_index_pointer_mv = self.B_index_pointer_copy
9501  */
9502  __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L1_error))
9503  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
9504  __Pyx_GOTREF(__pyx_t_5);
9505  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 838, __pyx_L1_error)
9506  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9507  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9508  __pyx_v_B_data_mv = __pyx_t_6;
9509  __pyx_t_6.memview = NULL;
9510  __pyx_t_6.data = NULL;
9511 
9512  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":839
9513  *
9514  * B_data_mv = B.data
9515  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
9516  * B_index_pointer_mv = self.B_index_pointer_copy
9517  *
9518  */
9519  __Pyx_TraceLine(839,0,__PYX_ERR(0, 839, __pyx_L1_error))
9520  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 839, __pyx_L1_error)
9521  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9522  __pyx_v_B_indices_mv = __pyx_t_7;
9523  __pyx_t_7.memview = NULL;
9524  __pyx_t_7.data = NULL;
9525 
9526  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":840
9527  * B_data_mv = B.data
9528  * B_indices_mv = self.B_indices_copy
9529  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
9530  *
9531  * # Declare pointers
9532  */
9533  __Pyx_TraceLine(840,0,__PYX_ERR(0, 840, __pyx_L1_error))
9534  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 840, __pyx_L1_error)
9535  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9536  __pyx_v_B_index_pointer_mv = __pyx_t_7;
9537  __pyx_t_7.memview = NULL;
9538  __pyx_t_7.data = NULL;
9539 
9540  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":830
9541  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
9542  *
9543  * if not B_is_identity: # <<<<<<<<<<<<<<
9544  *
9545  * # If input type is the same as LongIndexType, no copy is performed.
9546  */
9547  }
9548 
9549  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":843
9550  *
9551  * # Declare pointers
9552  * cdef float* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
9553  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9554  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9555  */
9556  __Pyx_TraceLine(843,0,__PYX_ERR(0, 843, __pyx_L1_error))
9557  __pyx_t_10 = 0;
9558  __pyx_v_A_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
9559 
9560  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":844
9561  * # Declare pointers
9562  * cdef float* A_data = &A_data_mv[0]
9563  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
9564  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9565  * cdef float* B_data = NULL
9566  */
9567  __Pyx_TraceLine(844,0,__PYX_ERR(0, 844, __pyx_L1_error))
9568  __pyx_t_10 = 0;
9569  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
9570 
9571  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":845
9572  * cdef float* A_data = &A_data_mv[0]
9573  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9574  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
9575  * cdef float* B_data = NULL
9576  * cdef LongIndexType* B_indices = NULL
9577  */
9578  __Pyx_TraceLine(845,0,__PYX_ERR(0, 845, __pyx_L1_error))
9579  __pyx_t_10 = 0;
9580  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
9581 
9582  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":846
9583  * cdef LongIndexType* A_indices = &A_indices_mv[0]
9584  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9585  * cdef float* B_data = NULL # <<<<<<<<<<<<<<
9586  * cdef LongIndexType* B_indices = NULL
9587  * cdef LongIndexType* B_index_pointer = NULL
9588  */
9589  __Pyx_TraceLine(846,0,__PYX_ERR(0, 846, __pyx_L1_error))
9590  __pyx_v_B_data = NULL;
9591 
9592  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":847
9593  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
9594  * cdef float* B_data = NULL
9595  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
9596  * cdef LongIndexType* B_index_pointer = NULL
9597  *
9598  */
9599  __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error))
9600  __pyx_v_B_indices = NULL;
9601 
9602  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":848
9603  * cdef float* B_data = NULL
9604  * cdef LongIndexType* B_indices = NULL
9605  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
9606  *
9607  * if not B_is_identity:
9608  */
9609  __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L1_error))
9610  __pyx_v_B_index_pointer = NULL;
9611 
9612  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":850
9613  * cdef LongIndexType* B_index_pointer = NULL
9614  *
9615  * if not B_is_identity: # <<<<<<<<<<<<<<
9616  * B_data = &B_data_mv[0]
9617  * B_indices = &B_indices_mv[0]
9618  */
9619  __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error))
9620  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 850, __pyx_L1_error)
9621  __pyx_t_8 = ((!__pyx_t_9) != 0);
9622  if (__pyx_t_8) {
9623 
9624  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":851
9625  *
9626  * if not B_is_identity:
9627  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
9628  * B_indices = &B_indices_mv[0]
9629  * B_index_pointer = &B_index_pointer_mv[0]
9630  */
9631  __Pyx_TraceLine(851,0,__PYX_ERR(0, 851, __pyx_L1_error))
9632  __pyx_t_10 = 0;
9633  __pyx_v_B_data = (&(*((float *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
9634 
9635  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":852
9636  * if not B_is_identity:
9637  * B_data = &B_data_mv[0]
9638  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
9639  * B_index_pointer = &B_index_pointer_mv[0]
9640  *
9641  */
9642  __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L1_error))
9643  __pyx_t_10 = 0;
9644  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
9645 
9646  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":853
9647  * B_data = &B_data_mv[0]
9648  * B_indices = &B_indices_mv[0]
9649  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
9650  *
9651  * # Create a linear operator object
9652  */
9653  __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
9654  __pyx_t_10 = 0;
9655  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
9656 
9657  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":850
9658  * cdef LongIndexType* B_index_pointer = NULL
9659  *
9660  * if not B_is_identity: # <<<<<<<<<<<<<<
9661  * B_data = &B_data_mv[0]
9662  * B_indices = &B_indices_mv[0]
9663  */
9664  }
9665 
9666  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":856
9667  *
9668  * # Create a linear operator object
9669  * if B_is_identity: # <<<<<<<<<<<<<<
9670  * self.Aop_float = new cCSCAffineMatrixFunction[float](
9671  * A_data,
9672  */
9673  __Pyx_TraceLine(856,0,__PYX_ERR(0, 856, __pyx_L1_error))
9674  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 856, __pyx_L1_error)
9675  if (__pyx_t_8) {
9676 
9677  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":857
9678  * # Create a linear operator object
9679  * if B_is_identity:
9680  * self.Aop_float = new cCSCAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
9681  * A_data,
9682  * A_indices,
9683  */
9684  __Pyx_TraceLine(857,0,__PYX_ERR(0, 857, __pyx_L1_error))
9685  try {
9686  __pyx_t_11 = new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
9687  } catch(...) {
9688  __Pyx_CppExn2PyErr();
9689  __PYX_ERR(0, 857, __pyx_L1_error)
9690  }
9691  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9692 
9693  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":856
9694  *
9695  * # Create a linear operator object
9696  * if B_is_identity: # <<<<<<<<<<<<<<
9697  * self.Aop_float = new cCSCAffineMatrixFunction[float](
9698  * A_data,
9699  */
9700  goto __pyx_L5;
9701  }
9702 
9703  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":864
9704  * A_num_columns)
9705  * else:
9706  * self.Aop_float = new cCSCAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
9707  * A_data,
9708  * A_indices,
9709  */
9710  __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9711  /*else*/ {
9712 
9713  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":872
9714  * B_data,
9715  * B_indices,
9716  * B_index_pointer) # <<<<<<<<<<<<<<
9717  *
9718  * # =====================
9719  */
9720  __Pyx_TraceLine(872,0,__PYX_ERR(0, 872, __pyx_L1_error))
9721  try {
9722  __pyx_t_11 = new cCSCAffineMatrixFunction<float> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
9723  } catch(...) {
9724  __Pyx_CppExn2PyErr();
9725  __PYX_ERR(0, 864, __pyx_L1_error)
9726  }
9727 
9728  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":864
9729  * A_num_columns)
9730  * else:
9731  * self.Aop_float = new cCSCAffineMatrixFunction[float]( # <<<<<<<<<<<<<<
9732  * A_data,
9733  * A_indices,
9734  */
9735  __Pyx_TraceLine(864,0,__PYX_ERR(0, 864, __pyx_L1_error))
9736  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_11;
9737  }
9738  __pyx_L5:;
9739 
9740  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
9741  * # ====================
9742  *
9743  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9744  * """
9745  * """
9746  */
9747 
9748  /* function exit code */
9749  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9750  goto __pyx_L0;
9751  __pyx_L1_error:;
9752  __Pyx_XDECREF(__pyx_t_1);
9753  __Pyx_XDECREF(__pyx_t_2);
9754  __Pyx_XDECREF(__pyx_t_4);
9755  __Pyx_XDECREF(__pyx_t_5);
9756  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
9757  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
9758  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
9759  __pyx_r = NULL;
9760  __pyx_L0:;
9761  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
9762  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
9763  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
9764  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
9765  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
9766  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
9767  __Pyx_XGIVEREF(__pyx_r);
9768  __Pyx_TraceReturn(__pyx_r, 0);
9769  __Pyx_RefNannyFinishContext();
9770  return __pyx_r;
9771 }
9772 
9773 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
9774  * # =====================
9775  *
9776  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
9777  * """
9778  * """
9779  */
9780 
9781 /* Python wrapper */
9782 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9783 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double[] = "pycAffineMatrixFunction.set_csc_matrix_double(self, A, B, B_is_identity)\n\n ";
9784 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double = {"set_csc_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double};
9785 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9786  PyObject *__pyx_v_A = 0;
9787  PyObject *__pyx_v_B = 0;
9788  PyObject *__pyx_v_B_is_identity = 0;
9789  int __pyx_lineno = 0;
9790  const char *__pyx_filename = NULL;
9791  int __pyx_clineno = 0;
9792  PyObject *__pyx_r = 0;
9793  __Pyx_RefNannyDeclarations
9794  __Pyx_RefNannySetupContext("set_csc_matrix_double (wrapper)", 0);
9795  {
9796  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
9797  PyObject* values[3] = {0,0,0};
9798  if (unlikely(__pyx_kwds)) {
9799  Py_ssize_t kw_args;
9800  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9801  switch (pos_args) {
9802  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9803  CYTHON_FALLTHROUGH;
9804  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9805  CYTHON_FALLTHROUGH;
9806  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9807  CYTHON_FALLTHROUGH;
9808  case 0: break;
9809  default: goto __pyx_L5_argtuple_error;
9810  }
9811  kw_args = PyDict_Size(__pyx_kwds);
9812  switch (pos_args) {
9813  case 0:
9814  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
9815  else goto __pyx_L5_argtuple_error;
9816  CYTHON_FALLTHROUGH;
9817  case 1:
9818  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
9819  else {
9820  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_double", 1, 3, 3, 1); __PYX_ERR(0, 878, __pyx_L3_error)
9821  }
9822  CYTHON_FALLTHROUGH;
9823  case 2:
9824  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
9825  else {
9826  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_double", 1, 3, 3, 2); __PYX_ERR(0, 878, __pyx_L3_error)
9827  }
9828  }
9829  if (unlikely(kw_args > 0)) {
9830  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csc_matrix_double") < 0)) __PYX_ERR(0, 878, __pyx_L3_error)
9831  }
9832  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9833  goto __pyx_L5_argtuple_error;
9834  } else {
9835  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9836  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9837  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9838  }
9839  __pyx_v_A = values[0];
9840  __pyx_v_B = values[1];
9841  __pyx_v_B_is_identity = values[2];
9842  }
9843  goto __pyx_L4_argument_unpacking_done;
9844  __pyx_L5_argtuple_error:;
9845  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 878, __pyx_L3_error)
9846  __pyx_L3_error:;
9847  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
9848  __Pyx_RefNannyFinishContext();
9849  return NULL;
9850  __pyx_L4_argument_unpacking_done:;
9851  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
9852 
9853  /* function exit code */
9854  __Pyx_RefNannyFinishContext();
9855  return __pyx_r;
9856 }
9857 
9858 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
9859  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
9860  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
9861  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9862  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9863  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9864  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9865  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9866  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
9867  double *__pyx_v_A_data;
9868  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
9869  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
9870  double *__pyx_v_B_data;
9871  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
9872  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
9873  PyObject *__pyx_r = NULL;
9874  __Pyx_TraceDeclarations
9875  __Pyx_RefNannyDeclarations
9876  PyObject *__pyx_t_1 = NULL;
9877  PyObject *__pyx_t_2 = NULL;
9878  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
9879  PyObject *__pyx_t_4 = NULL;
9880  PyObject *__pyx_t_5 = NULL;
9881  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
9882  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
9883  int __pyx_t_8;
9884  int __pyx_t_9;
9885  Py_ssize_t __pyx_t_10;
9887  int __pyx_lineno = 0;
9888  const char *__pyx_filename = NULL;
9889  int __pyx_clineno = 0;
9890  __Pyx_TraceFrameInit(__pyx_codeobj__16)
9891  __Pyx_RefNannySetupContext("set_csc_matrix_double", 0);
9892  __Pyx_TraceCall("set_csc_matrix_double", __pyx_f[0], 878, 0, __PYX_ERR(0, 878, __pyx_L1_error));
9893 
9894  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":883
9895  *
9896  * # Matrix size
9897  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
9898  * cdef LongIndexType A_num_columns = A.shape[1]
9899  *
9900  */
9901  __Pyx_TraceLine(883,0,__PYX_ERR(0, 883, __pyx_L1_error))
9902  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
9903  __Pyx_GOTREF(__pyx_t_1);
9904  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
9905  __Pyx_GOTREF(__pyx_t_2);
9906  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9907  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error)
9908  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9909  __pyx_v_A_num_rows = __pyx_t_3;
9910 
9911  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":884
9912  * # Matrix size
9913  * cdef LongIndexType A_num_rows = A.shape[0]
9914  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
9915  *
9916  * # If the input type is the same as LongIndexType, no copy is performed.
9917  */
9918  __Pyx_TraceLine(884,0,__PYX_ERR(0, 884, __pyx_L1_error))
9919  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error)
9920  __Pyx_GOTREF(__pyx_t_2);
9921  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
9922  __Pyx_GOTREF(__pyx_t_1);
9923  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9924  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L1_error)
9925  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9926  __pyx_v_A_num_columns = __pyx_t_3;
9927 
9928  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":888
9929  * # If the input type is the same as LongIndexType, no copy is performed.
9930  * self.A_indices_copy = \
9931  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9932  * self.A_index_pointer_copy = \
9933  * A.indptr.astype(self.long_index_type_name, copy=False)
9934  */
9935  __Pyx_TraceLine(888,0,__PYX_ERR(0, 888, __pyx_L1_error))
9936  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
9937  __Pyx_GOTREF(__pyx_t_1);
9938  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
9939  __Pyx_GOTREF(__pyx_t_2);
9940  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9941  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
9942  __Pyx_GOTREF(__pyx_t_1);
9943  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
9944  __Pyx_GOTREF(__pyx_t_4);
9945  __Pyx_GIVEREF(__pyx_t_1);
9946  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9947  __pyx_t_1 = 0;
9948  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
9949  __Pyx_GOTREF(__pyx_t_1);
9950  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
9951  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
9952  __Pyx_GOTREF(__pyx_t_5);
9953  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9954  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9955  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9956 
9957  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":887
9958  *
9959  * # If the input type is the same as LongIndexType, no copy is performed.
9960  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
9961  * A.indices.astype(self.long_index_type_name, copy=False)
9962  * self.A_index_pointer_copy = \
9963  */
9964  __Pyx_TraceLine(887,0,__PYX_ERR(0, 887, __pyx_L1_error))
9965  __Pyx_GIVEREF(__pyx_t_5);
9966  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
9967  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
9968  __pyx_v_self->A_indices_copy = __pyx_t_5;
9969  __pyx_t_5 = 0;
9970 
9971  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":890
9972  * A.indices.astype(self.long_index_type_name, copy=False)
9973  * self.A_index_pointer_copy = \
9974  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
9975  *
9976  * # Declare memoryviews to get pointers
9977  */
9978  __Pyx_TraceLine(890,0,__PYX_ERR(0, 890, __pyx_L1_error))
9979  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
9980  __Pyx_GOTREF(__pyx_t_5);
9981  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
9982  __Pyx_GOTREF(__pyx_t_1);
9983  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9984  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
9985  __Pyx_GOTREF(__pyx_t_5);
9986  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error)
9987  __Pyx_GOTREF(__pyx_t_4);
9988  __Pyx_GIVEREF(__pyx_t_5);
9989  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9990  __pyx_t_5 = 0;
9991  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
9992  __Pyx_GOTREF(__pyx_t_5);
9993  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
9994  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error)
9995  __Pyx_GOTREF(__pyx_t_2);
9996  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9997  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9998  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9999 
10000  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":889
10001  * self.A_indices_copy = \
10002  * A.indices.astype(self.long_index_type_name, copy=False)
10003  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
10004  * A.indptr.astype(self.long_index_type_name, copy=False)
10005  *
10006  */
10007  __Pyx_TraceLine(889,0,__PYX_ERR(0, 889, __pyx_L1_error))
10008  __Pyx_GIVEREF(__pyx_t_2);
10009  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10010  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10011  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10012  __pyx_t_2 = 0;
10013 
10014  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":893
10015  *
10016  * # Declare memoryviews to get pointers
10017  * cdef double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
10018  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10019  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10020  */
10021  __Pyx_TraceLine(893,0,__PYX_ERR(0, 893, __pyx_L1_error))
10022  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
10023  __Pyx_GOTREF(__pyx_t_2);
10024  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 893, __pyx_L1_error)
10025  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10026  __pyx_v_A_data_mv = __pyx_t_6;
10027  __pyx_t_6.memview = NULL;
10028  __pyx_t_6.data = NULL;
10029 
10030  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":894
10031  * # Declare memoryviews to get pointers
10032  * cdef double[:] A_data_mv = A.data
10033  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
10034  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10035  * self.A_index_pointer_copy
10036  */
10037  __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L1_error))
10038  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 894, __pyx_L1_error)
10039  __pyx_v_A_indices_mv = __pyx_t_7;
10040  __pyx_t_7.memview = NULL;
10041  __pyx_t_7.data = NULL;
10042 
10043  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":896
10044  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10045  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10046  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
10047  * cdef double[:] B_data_mv = None
10048  * cdef MemoryViewLongIndexType B_indices_mv = None
10049  */
10050  __Pyx_TraceLine(896,0,__PYX_ERR(0, 896, __pyx_L1_error))
10051  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 896, __pyx_L1_error)
10052  __pyx_v_A_index_pointer_mv = __pyx_t_7;
10053  __pyx_t_7.memview = NULL;
10054  __pyx_t_7.data = NULL;
10055 
10056  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":897
10057  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10058  * self.A_index_pointer_copy
10059  * cdef double[:] B_data_mv = None # <<<<<<<<<<<<<<
10060  * cdef MemoryViewLongIndexType B_indices_mv = None
10061  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10062  */
10063  __Pyx_TraceLine(897,0,__PYX_ERR(0, 897, __pyx_L1_error))
10064  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 897, __pyx_L1_error)
10065  __pyx_v_B_data_mv = __pyx_t_6;
10066  __pyx_t_6.memview = NULL;
10067  __pyx_t_6.data = NULL;
10068 
10069  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":898
10070  * self.A_index_pointer_copy
10071  * cdef double[:] B_data_mv = None
10072  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
10073  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10074  *
10075  */
10076  __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
10077  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 898, __pyx_L1_error)
10078  __pyx_v_B_indices_mv = __pyx_t_7;
10079  __pyx_t_7.memview = NULL;
10080  __pyx_t_7.data = NULL;
10081 
10082  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":899
10083  * cdef double[:] B_data_mv = None
10084  * cdef MemoryViewLongIndexType B_indices_mv = None
10085  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
10086  *
10087  * if not B_is_identity:
10088  */
10089  __Pyx_TraceLine(899,0,__PYX_ERR(0, 899, __pyx_L1_error))
10090  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 899, __pyx_L1_error)
10091  __pyx_v_B_index_pointer_mv = __pyx_t_7;
10092  __pyx_t_7.memview = NULL;
10093  __pyx_t_7.data = NULL;
10094 
10095  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":901
10096  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10097  *
10098  * if not B_is_identity: # <<<<<<<<<<<<<<
10099  *
10100  * # If input type is the same as LongIndexType, no copy is performed.
10101  */
10102  __Pyx_TraceLine(901,0,__PYX_ERR(0, 901, __pyx_L1_error))
10103  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
10104  __pyx_t_9 = ((!__pyx_t_8) != 0);
10105  if (__pyx_t_9) {
10106 
10107  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":905
10108  * # If input type is the same as LongIndexType, no copy is performed.
10109  * self.B_indices_copy = \
10110  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10111  * self.B_index_pointer_copy = \
10112  * B.indptr.astype(self.long_index_type_name, copy=False)
10113  */
10114  __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
10115  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10116  __Pyx_GOTREF(__pyx_t_2);
10117  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
10118  __Pyx_GOTREF(__pyx_t_5);
10119  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10120  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10121  __Pyx_GOTREF(__pyx_t_2);
10122  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
10123  __Pyx_GOTREF(__pyx_t_4);
10124  __Pyx_GIVEREF(__pyx_t_2);
10125  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10126  __pyx_t_2 = 0;
10127  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
10128  __Pyx_GOTREF(__pyx_t_2);
10129  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 905, __pyx_L1_error)
10130  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
10131  __Pyx_GOTREF(__pyx_t_1);
10132  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10133  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10134  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10135 
10136  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":904
10137  *
10138  * # If input type is the same as LongIndexType, no copy is performed.
10139  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
10140  * B.indices.astype(self.long_index_type_name, copy=False)
10141  * self.B_index_pointer_copy = \
10142  */
10143  __Pyx_TraceLine(904,0,__PYX_ERR(0, 904, __pyx_L1_error))
10144  __Pyx_GIVEREF(__pyx_t_1);
10145  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
10146  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
10147  __pyx_v_self->B_indices_copy = __pyx_t_1;
10148  __pyx_t_1 = 0;
10149 
10150  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":907
10151  * B.indices.astype(self.long_index_type_name, copy=False)
10152  * self.B_index_pointer_copy = \
10153  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10154  *
10155  * B_data_mv = B.data
10156  */
10157  __Pyx_TraceLine(907,0,__PYX_ERR(0, 907, __pyx_L1_error))
10158  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10159  __Pyx_GOTREF(__pyx_t_1);
10160  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
10161  __Pyx_GOTREF(__pyx_t_2);
10162  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10163  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10164  __Pyx_GOTREF(__pyx_t_1);
10165  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
10166  __Pyx_GOTREF(__pyx_t_4);
10167  __Pyx_GIVEREF(__pyx_t_1);
10168  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10169  __pyx_t_1 = 0;
10170  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
10171  __Pyx_GOTREF(__pyx_t_1);
10172  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
10173  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
10174  __Pyx_GOTREF(__pyx_t_5);
10175  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10176  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10177  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10178 
10179  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":906
10180  * self.B_indices_copy = \
10181  * B.indices.astype(self.long_index_type_name, copy=False)
10182  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
10183  * B.indptr.astype(self.long_index_type_name, copy=False)
10184  *
10185  */
10186  __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L1_error))
10187  __Pyx_GIVEREF(__pyx_t_5);
10188  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
10189  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
10190  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
10191  __pyx_t_5 = 0;
10192 
10193  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":909
10194  * B.indptr.astype(self.long_index_type_name, copy=False)
10195  *
10196  * B_data_mv = B.data # <<<<<<<<<<<<<<
10197  * B_indices_mv = self.B_indices_copy
10198  * B_index_pointer_mv = self.B_index_pointer_copy
10199  */
10200  __Pyx_TraceLine(909,0,__PYX_ERR(0, 909, __pyx_L1_error))
10201  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
10202  __Pyx_GOTREF(__pyx_t_5);
10203  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 909, __pyx_L1_error)
10204  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10205  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10206  __pyx_v_B_data_mv = __pyx_t_6;
10207  __pyx_t_6.memview = NULL;
10208  __pyx_t_6.data = NULL;
10209 
10210  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":910
10211  *
10212  * B_data_mv = B.data
10213  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
10214  * B_index_pointer_mv = self.B_index_pointer_copy
10215  *
10216  */
10217  __Pyx_TraceLine(910,0,__PYX_ERR(0, 910, __pyx_L1_error))
10218  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 910, __pyx_L1_error)
10219  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10220  __pyx_v_B_indices_mv = __pyx_t_7;
10221  __pyx_t_7.memview = NULL;
10222  __pyx_t_7.data = NULL;
10223 
10224  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":911
10225  * B_data_mv = B.data
10226  * B_indices_mv = self.B_indices_copy
10227  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
10228  *
10229  * # Declare pointers
10230  */
10231  __Pyx_TraceLine(911,0,__PYX_ERR(0, 911, __pyx_L1_error))
10232  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 911, __pyx_L1_error)
10233  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10234  __pyx_v_B_index_pointer_mv = __pyx_t_7;
10235  __pyx_t_7.memview = NULL;
10236  __pyx_t_7.data = NULL;
10237 
10238  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":901
10239  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10240  *
10241  * if not B_is_identity: # <<<<<<<<<<<<<<
10242  *
10243  * # If input type is the same as LongIndexType, no copy is performed.
10244  */
10245  }
10246 
10247  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":914
10248  *
10249  * # Declare pointers
10250  * cdef double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
10251  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10252  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10253  */
10254  __Pyx_TraceLine(914,0,__PYX_ERR(0, 914, __pyx_L1_error))
10255  __pyx_t_10 = 0;
10256  __pyx_v_A_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
10257 
10258  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":915
10259  * # Declare pointers
10260  * cdef double* A_data = &A_data_mv[0]
10261  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
10262  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10263  * cdef double* B_data = NULL
10264  */
10265  __Pyx_TraceLine(915,0,__PYX_ERR(0, 915, __pyx_L1_error))
10266  __pyx_t_10 = 0;
10267  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
10268 
10269  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":916
10270  * cdef double* A_data = &A_data_mv[0]
10271  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10272  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
10273  * cdef double* B_data = NULL
10274  * cdef LongIndexType* B_indices = NULL
10275  */
10276  __Pyx_TraceLine(916,0,__PYX_ERR(0, 916, __pyx_L1_error))
10277  __pyx_t_10 = 0;
10278  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
10279 
10280  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":917
10281  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10282  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10283  * cdef double* B_data = NULL # <<<<<<<<<<<<<<
10284  * cdef LongIndexType* B_indices = NULL
10285  * cdef LongIndexType* B_index_pointer = NULL
10286  */
10287  __Pyx_TraceLine(917,0,__PYX_ERR(0, 917, __pyx_L1_error))
10288  __pyx_v_B_data = NULL;
10289 
10290  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":918
10291  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10292  * cdef double* B_data = NULL
10293  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
10294  * cdef LongIndexType* B_index_pointer = NULL
10295  *
10296  */
10297  __Pyx_TraceLine(918,0,__PYX_ERR(0, 918, __pyx_L1_error))
10298  __pyx_v_B_indices = NULL;
10299 
10300  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":919
10301  * cdef double* B_data = NULL
10302  * cdef LongIndexType* B_indices = NULL
10303  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
10304  *
10305  * if not B_is_identity:
10306  */
10307  __Pyx_TraceLine(919,0,__PYX_ERR(0, 919, __pyx_L1_error))
10308  __pyx_v_B_index_pointer = NULL;
10309 
10310  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":921
10311  * cdef LongIndexType* B_index_pointer = NULL
10312  *
10313  * if not B_is_identity: # <<<<<<<<<<<<<<
10314  * B_data = &B_data_mv[0]
10315  * B_indices = &B_indices_mv[0]
10316  */
10317  __Pyx_TraceLine(921,0,__PYX_ERR(0, 921, __pyx_L1_error))
10318  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 921, __pyx_L1_error)
10319  __pyx_t_8 = ((!__pyx_t_9) != 0);
10320  if (__pyx_t_8) {
10321 
10322  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":922
10323  *
10324  * if not B_is_identity:
10325  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
10326  * B_indices = &B_indices_mv[0]
10327  * B_index_pointer = &B_index_pointer_mv[0]
10328  */
10329  __Pyx_TraceLine(922,0,__PYX_ERR(0, 922, __pyx_L1_error))
10330  __pyx_t_10 = 0;
10331  __pyx_v_B_data = (&(*((double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
10332 
10333  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":923
10334  * if not B_is_identity:
10335  * B_data = &B_data_mv[0]
10336  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
10337  * B_index_pointer = &B_index_pointer_mv[0]
10338  *
10339  */
10340  __Pyx_TraceLine(923,0,__PYX_ERR(0, 923, __pyx_L1_error))
10341  __pyx_t_10 = 0;
10342  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
10343 
10344  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":924
10345  * B_data = &B_data_mv[0]
10346  * B_indices = &B_indices_mv[0]
10347  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
10348  *
10349  * # Create a linear operator object
10350  */
10351  __Pyx_TraceLine(924,0,__PYX_ERR(0, 924, __pyx_L1_error))
10352  __pyx_t_10 = 0;
10353  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
10354 
10355  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":921
10356  * cdef LongIndexType* B_index_pointer = NULL
10357  *
10358  * if not B_is_identity: # <<<<<<<<<<<<<<
10359  * B_data = &B_data_mv[0]
10360  * B_indices = &B_indices_mv[0]
10361  */
10362  }
10363 
10364  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":927
10365  *
10366  * # Create a linear operator object
10367  * if B_is_identity: # <<<<<<<<<<<<<<
10368  * self.Aop_double = new cCSCAffineMatrixFunction[double](
10369  * A_data,
10370  */
10371  __Pyx_TraceLine(927,0,__PYX_ERR(0, 927, __pyx_L1_error))
10372  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 927, __pyx_L1_error)
10373  if (__pyx_t_8) {
10374 
10375  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":928
10376  * # Create a linear operator object
10377  * if B_is_identity:
10378  * self.Aop_double = new cCSCAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
10379  * A_data,
10380  * A_indices,
10381  */
10382  __Pyx_TraceLine(928,0,__PYX_ERR(0, 928, __pyx_L1_error))
10383  try {
10384  __pyx_t_11 = new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
10385  } catch(...) {
10386  __Pyx_CppExn2PyErr();
10387  __PYX_ERR(0, 928, __pyx_L1_error)
10388  }
10389  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10390 
10391  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":927
10392  *
10393  * # Create a linear operator object
10394  * if B_is_identity: # <<<<<<<<<<<<<<
10395  * self.Aop_double = new cCSCAffineMatrixFunction[double](
10396  * A_data,
10397  */
10398  goto __pyx_L5;
10399  }
10400 
10401  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":935
10402  * A_num_columns)
10403  * else:
10404  * self.Aop_double = new cCSCAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
10405  * A_data,
10406  * A_indices,
10407  */
10408  __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10409  /*else*/ {
10410 
10411  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":943
10412  * B_data,
10413  * B_indices,
10414  * B_index_pointer) # <<<<<<<<<<<<<<
10415  *
10416  * # ==========================
10417  */
10418  __Pyx_TraceLine(943,0,__PYX_ERR(0, 943, __pyx_L1_error))
10419  try {
10420  __pyx_t_11 = new cCSCAffineMatrixFunction<double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
10421  } catch(...) {
10422  __Pyx_CppExn2PyErr();
10423  __PYX_ERR(0, 935, __pyx_L1_error)
10424  }
10425 
10426  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":935
10427  * A_num_columns)
10428  * else:
10429  * self.Aop_double = new cCSCAffineMatrixFunction[double]( # <<<<<<<<<<<<<<
10430  * A_data,
10431  * A_indices,
10432  */
10433  __Pyx_TraceLine(935,0,__PYX_ERR(0, 935, __pyx_L1_error))
10434  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_11;
10435  }
10436  __pyx_L5:;
10437 
10438  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
10439  * # =====================
10440  *
10441  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
10442  * """
10443  * """
10444  */
10445 
10446  /* function exit code */
10447  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10448  goto __pyx_L0;
10449  __pyx_L1_error:;
10450  __Pyx_XDECREF(__pyx_t_1);
10451  __Pyx_XDECREF(__pyx_t_2);
10452  __Pyx_XDECREF(__pyx_t_4);
10453  __Pyx_XDECREF(__pyx_t_5);
10454  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
10455  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
10456  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10457  __pyx_r = NULL;
10458  __pyx_L0:;
10459  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
10460  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
10461  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
10462  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10463  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10464  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10465  __Pyx_XGIVEREF(__pyx_r);
10466  __Pyx_TraceReturn(__pyx_r, 0);
10467  __Pyx_RefNannyFinishContext();
10468  return __pyx_r;
10469 }
10470 
10471 /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
10472  * # ==========================
10473  *
10474  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
10475  * """
10476  * """
10477  */
10478 
10479 /* Python wrapper */
10480 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10481 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double[] = "pycAffineMatrixFunction.set_csc_matrix_long_double(self, A, B, B_is_identity)\n\n ";
10482 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double = {"set_csc_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double};
10483 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10484  PyObject *__pyx_v_A = 0;
10485  PyObject *__pyx_v_B = 0;
10486  PyObject *__pyx_v_B_is_identity = 0;
10487  int __pyx_lineno = 0;
10488  const char *__pyx_filename = NULL;
10489  int __pyx_clineno = 0;
10490  PyObject *__pyx_r = 0;
10491  __Pyx_RefNannyDeclarations
10492  __Pyx_RefNannySetupContext("set_csc_matrix_long_double (wrapper)", 0);
10493  {
10494  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_B_is_identity,0};
10495  PyObject* values[3] = {0,0,0};
10496  if (unlikely(__pyx_kwds)) {
10497  Py_ssize_t kw_args;
10498  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10499  switch (pos_args) {
10500  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10501  CYTHON_FALLTHROUGH;
10502  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10503  CYTHON_FALLTHROUGH;
10504  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10505  CYTHON_FALLTHROUGH;
10506  case 0: break;
10507  default: goto __pyx_L5_argtuple_error;
10508  }
10509  kw_args = PyDict_Size(__pyx_kwds);
10510  switch (pos_args) {
10511  case 0:
10512  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
10513  else goto __pyx_L5_argtuple_error;
10514  CYTHON_FALLTHROUGH;
10515  case 1:
10516  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
10517  else {
10518  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_long_double", 1, 3, 3, 1); __PYX_ERR(0, 949, __pyx_L3_error)
10519  }
10520  CYTHON_FALLTHROUGH;
10521  case 2:
10522  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B_is_identity)) != 0)) kw_args--;
10523  else {
10524  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_long_double", 1, 3, 3, 2); __PYX_ERR(0, 949, __pyx_L3_error)
10525  }
10526  }
10527  if (unlikely(kw_args > 0)) {
10528  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_csc_matrix_long_double") < 0)) __PYX_ERR(0, 949, __pyx_L3_error)
10529  }
10530  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10531  goto __pyx_L5_argtuple_error;
10532  } else {
10533  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10534  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10535  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10536  }
10537  __pyx_v_A = values[0];
10538  __pyx_v_B = values[1];
10539  __pyx_v_B_is_identity = values[2];
10540  }
10541  goto __pyx_L4_argument_unpacking_done;
10542  __pyx_L5_argtuple_error:;
10543  __Pyx_RaiseArgtupleInvalid("set_csc_matrix_long_double", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 949, __pyx_L3_error)
10544  __pyx_L3_error:;
10545  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
10546  __Pyx_RefNannyFinishContext();
10547  return NULL;
10548  __pyx_L4_argument_unpacking_done:;
10549  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_B_is_identity);
10550 
10551  /* function exit code */
10552  __Pyx_RefNannyFinishContext();
10553  return __pyx_r;
10554 }
10555 
10556 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_B_is_identity) {
10557  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
10558  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
10559  __Pyx_memviewslice __pyx_v_A_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10560  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10561  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10562  __Pyx_memviewslice __pyx_v_B_data_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10563  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10564  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_B_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
10565  long double *__pyx_v_A_data;
10566  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
10567  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
10568  long double *__pyx_v_B_data;
10569  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_indices;
10570  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_B_index_pointer;
10571  PyObject *__pyx_r = NULL;
10572  __Pyx_TraceDeclarations
10573  __Pyx_RefNannyDeclarations
10574  PyObject *__pyx_t_1 = NULL;
10575  PyObject *__pyx_t_2 = NULL;
10576  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
10577  PyObject *__pyx_t_4 = NULL;
10578  PyObject *__pyx_t_5 = NULL;
10579  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
10580  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
10581  int __pyx_t_8;
10582  int __pyx_t_9;
10583  Py_ssize_t __pyx_t_10;
10585  int __pyx_lineno = 0;
10586  const char *__pyx_filename = NULL;
10587  int __pyx_clineno = 0;
10588  __Pyx_TraceFrameInit(__pyx_codeobj__17)
10589  __Pyx_RefNannySetupContext("set_csc_matrix_long_double", 0);
10590  __Pyx_TraceCall("set_csc_matrix_long_double", __pyx_f[0], 949, 0, __PYX_ERR(0, 949, __pyx_L1_error));
10591 
10592  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":954
10593  *
10594  * # Matrix size
10595  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
10596  * cdef LongIndexType A_num_columns = A.shape[1]
10597  *
10598  */
10599  __Pyx_TraceLine(954,0,__PYX_ERR(0, 954, __pyx_L1_error))
10600  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
10601  __Pyx_GOTREF(__pyx_t_1);
10602  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
10603  __Pyx_GOTREF(__pyx_t_2);
10604  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10605  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L1_error)
10606  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10607  __pyx_v_A_num_rows = __pyx_t_3;
10608 
10609  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":955
10610  * # Matrix size
10611  * cdef LongIndexType A_num_rows = A.shape[0]
10612  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
10613  *
10614  * # If the input type is the same as LongIndexType, no copy is performed.
10615  */
10616  __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error))
10617  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
10618  __Pyx_GOTREF(__pyx_t_2);
10619  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
10620  __Pyx_GOTREF(__pyx_t_1);
10621  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10622  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error)
10623  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10624  __pyx_v_A_num_columns = __pyx_t_3;
10625 
10626  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":959
10627  * # If the input type is the same as LongIndexType, no copy is performed.
10628  * self.A_indices_copy = \
10629  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10630  * self.A_index_pointer_copy = \
10631  * A.indptr.astype(self.long_index_type_name, copy=False)
10632  */
10633  __Pyx_TraceLine(959,0,__PYX_ERR(0, 959, __pyx_L1_error))
10634  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10635  __Pyx_GOTREF(__pyx_t_1);
10636  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
10637  __Pyx_GOTREF(__pyx_t_2);
10638  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10639  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10640  __Pyx_GOTREF(__pyx_t_1);
10641  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 959, __pyx_L1_error)
10642  __Pyx_GOTREF(__pyx_t_4);
10643  __Pyx_GIVEREF(__pyx_t_1);
10644  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10645  __pyx_t_1 = 0;
10646  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
10647  __Pyx_GOTREF(__pyx_t_1);
10648  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
10649  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error)
10650  __Pyx_GOTREF(__pyx_t_5);
10651  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10652  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10653  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10654 
10655  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":958
10656  *
10657  * # If the input type is the same as LongIndexType, no copy is performed.
10658  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
10659  * A.indices.astype(self.long_index_type_name, copy=False)
10660  * self.A_index_pointer_copy = \
10661  */
10662  __Pyx_TraceLine(958,0,__PYX_ERR(0, 958, __pyx_L1_error))
10663  __Pyx_GIVEREF(__pyx_t_5);
10664  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
10665  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
10666  __pyx_v_self->A_indices_copy = __pyx_t_5;
10667  __pyx_t_5 = 0;
10668 
10669  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":961
10670  * A.indices.astype(self.long_index_type_name, copy=False)
10671  * self.A_index_pointer_copy = \
10672  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10673  *
10674  * # Declare memoryviews to get pointers
10675  */
10676  __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error))
10677  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10678  __Pyx_GOTREF(__pyx_t_5);
10679  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
10680  __Pyx_GOTREF(__pyx_t_1);
10681  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10682  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10683  __Pyx_GOTREF(__pyx_t_5);
10684  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L1_error)
10685  __Pyx_GOTREF(__pyx_t_4);
10686  __Pyx_GIVEREF(__pyx_t_5);
10687  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10688  __pyx_t_5 = 0;
10689  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
10690  __Pyx_GOTREF(__pyx_t_5);
10691  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 961, __pyx_L1_error)
10692  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
10693  __Pyx_GOTREF(__pyx_t_2);
10694  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10695  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10696  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10697 
10698  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":960
10699  * self.A_indices_copy = \
10700  * A.indices.astype(self.long_index_type_name, copy=False)
10701  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
10702  * A.indptr.astype(self.long_index_type_name, copy=False)
10703  *
10704  */
10705  __Pyx_TraceLine(960,0,__PYX_ERR(0, 960, __pyx_L1_error))
10706  __Pyx_GIVEREF(__pyx_t_2);
10707  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
10708  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
10709  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
10710  __pyx_t_2 = 0;
10711 
10712  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":964
10713  *
10714  * # Declare memoryviews to get pointers
10715  * cdef long double[:] A_data_mv = A.data # <<<<<<<<<<<<<<
10716  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10717  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10718  */
10719  __Pyx_TraceLine(964,0,__PYX_ERR(0, 964, __pyx_L1_error))
10720  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
10721  __Pyx_GOTREF(__pyx_t_2);
10722  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 964, __pyx_L1_error)
10723  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10724  __pyx_v_A_data_mv = __pyx_t_6;
10725  __pyx_t_6.memview = NULL;
10726  __pyx_t_6.data = NULL;
10727 
10728  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":965
10729  * # Declare memoryviews to get pointers
10730  * cdef long double[:] A_data_mv = A.data
10731  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
10732  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10733  * self.A_index_pointer_copy
10734  */
10735  __Pyx_TraceLine(965,0,__PYX_ERR(0, 965, __pyx_L1_error))
10736  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 965, __pyx_L1_error)
10737  __pyx_v_A_indices_mv = __pyx_t_7;
10738  __pyx_t_7.memview = NULL;
10739  __pyx_t_7.data = NULL;
10740 
10741  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":967
10742  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
10743  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10744  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
10745  * cdef long double[:] B_data_mv = None
10746  * cdef MemoryViewLongIndexType B_indices_mv = None
10747  */
10748  __Pyx_TraceLine(967,0,__PYX_ERR(0, 967, __pyx_L1_error))
10749  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 967, __pyx_L1_error)
10750  __pyx_v_A_index_pointer_mv = __pyx_t_7;
10751  __pyx_t_7.memview = NULL;
10752  __pyx_t_7.data = NULL;
10753 
10754  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":968
10755  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
10756  * self.A_index_pointer_copy
10757  * cdef long double[:] B_data_mv = None # <<<<<<<<<<<<<<
10758  * cdef MemoryViewLongIndexType B_indices_mv = None
10759  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10760  */
10761  __Pyx_TraceLine(968,0,__PYX_ERR(0, 968, __pyx_L1_error))
10762  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 968, __pyx_L1_error)
10763  __pyx_v_B_data_mv = __pyx_t_6;
10764  __pyx_t_6.memview = NULL;
10765  __pyx_t_6.data = NULL;
10766 
10767  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":969
10768  * self.A_index_pointer_copy
10769  * cdef long double[:] B_data_mv = None
10770  * cdef MemoryViewLongIndexType B_indices_mv = None # <<<<<<<<<<<<<<
10771  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10772  *
10773  */
10774  __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error))
10775  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 969, __pyx_L1_error)
10776  __pyx_v_B_indices_mv = __pyx_t_7;
10777  __pyx_t_7.memview = NULL;
10778  __pyx_t_7.data = NULL;
10779 
10780  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":970
10781  * cdef long double[:] B_data_mv = None
10782  * cdef MemoryViewLongIndexType B_indices_mv = None
10783  * cdef MemoryViewLongIndexType B_index_pointer_mv = None # <<<<<<<<<<<<<<
10784  *
10785  * if not B_is_identity:
10786  */
10787  __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error))
10788  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 970, __pyx_L1_error)
10789  __pyx_v_B_index_pointer_mv = __pyx_t_7;
10790  __pyx_t_7.memview = NULL;
10791  __pyx_t_7.data = NULL;
10792 
10793  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":972
10794  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10795  *
10796  * if not B_is_identity: # <<<<<<<<<<<<<<
10797  *
10798  * # If input type is the same as LongIndexType, no copy is performed.
10799  */
10800  __Pyx_TraceLine(972,0,__PYX_ERR(0, 972, __pyx_L1_error))
10801  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 972, __pyx_L1_error)
10802  __pyx_t_9 = ((!__pyx_t_8) != 0);
10803  if (__pyx_t_9) {
10804 
10805  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":976
10806  * # If input type is the same as LongIndexType, no copy is performed.
10807  * self.B_indices_copy = \
10808  * B.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10809  * self.B_index_pointer_copy = \
10810  * B.indptr.astype(self.long_index_type_name, copy=False)
10811  */
10812  __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error))
10813  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
10814  __Pyx_GOTREF(__pyx_t_2);
10815  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
10816  __Pyx_GOTREF(__pyx_t_5);
10817  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10818  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
10819  __Pyx_GOTREF(__pyx_t_2);
10820  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
10821  __Pyx_GOTREF(__pyx_t_4);
10822  __Pyx_GIVEREF(__pyx_t_2);
10823  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10824  __pyx_t_2 = 0;
10825  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
10826  __Pyx_GOTREF(__pyx_t_2);
10827  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
10828  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
10829  __Pyx_GOTREF(__pyx_t_1);
10830  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10831  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10832  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10833 
10834  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":975
10835  *
10836  * # If input type is the same as LongIndexType, no copy is performed.
10837  * self.B_indices_copy = \ # <<<<<<<<<<<<<<
10838  * B.indices.astype(self.long_index_type_name, copy=False)
10839  * self.B_index_pointer_copy = \
10840  */
10841  __Pyx_TraceLine(975,0,__PYX_ERR(0, 975, __pyx_L1_error))
10842  __Pyx_GIVEREF(__pyx_t_1);
10843  __Pyx_GOTREF(__pyx_v_self->B_indices_copy);
10844  __Pyx_DECREF(__pyx_v_self->B_indices_copy);
10845  __pyx_v_self->B_indices_copy = __pyx_t_1;
10846  __pyx_t_1 = 0;
10847 
10848  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":978
10849  * B.indices.astype(self.long_index_type_name, copy=False)
10850  * self.B_index_pointer_copy = \
10851  * B.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
10852  *
10853  * B_data_mv = B.data
10854  */
10855  __Pyx_TraceLine(978,0,__PYX_ERR(0, 978, __pyx_L1_error))
10856  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
10857  __Pyx_GOTREF(__pyx_t_1);
10858  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
10859  __Pyx_GOTREF(__pyx_t_2);
10860  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10861  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
10862  __Pyx_GOTREF(__pyx_t_1);
10863  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error)
10864  __Pyx_GOTREF(__pyx_t_4);
10865  __Pyx_GIVEREF(__pyx_t_1);
10866  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10867  __pyx_t_1 = 0;
10868  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
10869  __Pyx_GOTREF(__pyx_t_1);
10870  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
10871  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 978, __pyx_L1_error)
10872  __Pyx_GOTREF(__pyx_t_5);
10873  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10874  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10875  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10876 
10877  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":977
10878  * self.B_indices_copy = \
10879  * B.indices.astype(self.long_index_type_name, copy=False)
10880  * self.B_index_pointer_copy = \ # <<<<<<<<<<<<<<
10881  * B.indptr.astype(self.long_index_type_name, copy=False)
10882  *
10883  */
10884  __Pyx_TraceLine(977,0,__PYX_ERR(0, 977, __pyx_L1_error))
10885  __Pyx_GIVEREF(__pyx_t_5);
10886  __Pyx_GOTREF(__pyx_v_self->B_index_pointer_copy);
10887  __Pyx_DECREF(__pyx_v_self->B_index_pointer_copy);
10888  __pyx_v_self->B_index_pointer_copy = __pyx_t_5;
10889  __pyx_t_5 = 0;
10890 
10891  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":980
10892  * B.indptr.astype(self.long_index_type_name, copy=False)
10893  *
10894  * B_data_mv = B.data # <<<<<<<<<<<<<<
10895  * B_indices_mv = self.B_indices_copy
10896  * B_index_pointer_mv = self.B_index_pointer_copy
10897  */
10898  __Pyx_TraceLine(980,0,__PYX_ERR(0, 980, __pyx_L1_error))
10899  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error)
10900  __Pyx_GOTREF(__pyx_t_5);
10901  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 980, __pyx_L1_error)
10902  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10903  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
10904  __pyx_v_B_data_mv = __pyx_t_6;
10905  __pyx_t_6.memview = NULL;
10906  __pyx_t_6.data = NULL;
10907 
10908  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":981
10909  *
10910  * B_data_mv = B.data
10911  * B_indices_mv = self.B_indices_copy # <<<<<<<<<<<<<<
10912  * B_index_pointer_mv = self.B_index_pointer_copy
10913  *
10914  */
10915  __Pyx_TraceLine(981,0,__PYX_ERR(0, 981, __pyx_L1_error))
10916  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 981, __pyx_L1_error)
10917  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
10918  __pyx_v_B_indices_mv = __pyx_t_7;
10919  __pyx_t_7.memview = NULL;
10920  __pyx_t_7.data = NULL;
10921 
10922  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":982
10923  * B_data_mv = B.data
10924  * B_indices_mv = self.B_indices_copy
10925  * B_index_pointer_mv = self.B_index_pointer_copy # <<<<<<<<<<<<<<
10926  *
10927  * # Declare pointers
10928  */
10929  __Pyx_TraceLine(982,0,__PYX_ERR(0, 982, __pyx_L1_error))
10930  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->B_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 982, __pyx_L1_error)
10931  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
10932  __pyx_v_B_index_pointer_mv = __pyx_t_7;
10933  __pyx_t_7.memview = NULL;
10934  __pyx_t_7.data = NULL;
10935 
10936  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":972
10937  * cdef MemoryViewLongIndexType B_index_pointer_mv = None
10938  *
10939  * if not B_is_identity: # <<<<<<<<<<<<<<
10940  *
10941  * # If input type is the same as LongIndexType, no copy is performed.
10942  */
10943  }
10944 
10945  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":985
10946  *
10947  * # Declare pointers
10948  * cdef long double* A_data = &A_data_mv[0] # <<<<<<<<<<<<<<
10949  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10950  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10951  */
10952  __Pyx_TraceLine(985,0,__PYX_ERR(0, 985, __pyx_L1_error))
10953  __pyx_t_10 = 0;
10954  __pyx_v_A_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_mv.data + __pyx_t_10 * __pyx_v_A_data_mv.strides[0]) ))));
10955 
10956  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":986
10957  * # Declare pointers
10958  * cdef long double* A_data = &A_data_mv[0]
10959  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
10960  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10961  * cdef long double* B_data = NULL
10962  */
10963  __Pyx_TraceLine(986,0,__PYX_ERR(0, 986, __pyx_L1_error))
10964  __pyx_t_10 = 0;
10965  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_10 * __pyx_v_A_indices_mv.strides[0]) ))));
10966 
10967  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":987
10968  * cdef long double* A_data = &A_data_mv[0]
10969  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10970  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
10971  * cdef long double* B_data = NULL
10972  * cdef LongIndexType* B_indices = NULL
10973  */
10974  __Pyx_TraceLine(987,0,__PYX_ERR(0, 987, __pyx_L1_error))
10975  __pyx_t_10 = 0;
10976  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_10 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
10977 
10978  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":988
10979  * cdef LongIndexType* A_indices = &A_indices_mv[0]
10980  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10981  * cdef long double* B_data = NULL # <<<<<<<<<<<<<<
10982  * cdef LongIndexType* B_indices = NULL
10983  * cdef LongIndexType* B_index_pointer = NULL
10984  */
10985  __Pyx_TraceLine(988,0,__PYX_ERR(0, 988, __pyx_L1_error))
10986  __pyx_v_B_data = NULL;
10987 
10988  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":989
10989  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
10990  * cdef long double* B_data = NULL
10991  * cdef LongIndexType* B_indices = NULL # <<<<<<<<<<<<<<
10992  * cdef LongIndexType* B_index_pointer = NULL
10993  *
10994  */
10995  __Pyx_TraceLine(989,0,__PYX_ERR(0, 989, __pyx_L1_error))
10996  __pyx_v_B_indices = NULL;
10997 
10998  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":990
10999  * cdef long double* B_data = NULL
11000  * cdef LongIndexType* B_indices = NULL
11001  * cdef LongIndexType* B_index_pointer = NULL # <<<<<<<<<<<<<<
11002  *
11003  * if not B_is_identity:
11004  */
11005  __Pyx_TraceLine(990,0,__PYX_ERR(0, 990, __pyx_L1_error))
11006  __pyx_v_B_index_pointer = NULL;
11007 
11008  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":992
11009  * cdef LongIndexType* B_index_pointer = NULL
11010  *
11011  * if not B_is_identity: # <<<<<<<<<<<<<<
11012  * B_data = &B_data_mv[0]
11013  * B_indices = &B_indices_mv[0]
11014  */
11015  __Pyx_TraceLine(992,0,__PYX_ERR(0, 992, __pyx_L1_error))
11016  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
11017  __pyx_t_8 = ((!__pyx_t_9) != 0);
11018  if (__pyx_t_8) {
11019 
11020  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":993
11021  *
11022  * if not B_is_identity:
11023  * B_data = &B_data_mv[0] # <<<<<<<<<<<<<<
11024  * B_indices = &B_indices_mv[0]
11025  * B_index_pointer = &B_index_pointer_mv[0]
11026  */
11027  __Pyx_TraceLine(993,0,__PYX_ERR(0, 993, __pyx_L1_error))
11028  __pyx_t_10 = 0;
11029  __pyx_v_B_data = (&(*((long double *) ( /* dim=0 */ (__pyx_v_B_data_mv.data + __pyx_t_10 * __pyx_v_B_data_mv.strides[0]) ))));
11030 
11031  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":994
11032  * if not B_is_identity:
11033  * B_data = &B_data_mv[0]
11034  * B_indices = &B_indices_mv[0] # <<<<<<<<<<<<<<
11035  * B_index_pointer = &B_index_pointer_mv[0]
11036  *
11037  */
11038  __Pyx_TraceLine(994,0,__PYX_ERR(0, 994, __pyx_L1_error))
11039  __pyx_t_10 = 0;
11040  __pyx_v_B_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_indices_mv.data + __pyx_t_10 * __pyx_v_B_indices_mv.strides[0]) ))));
11041 
11042  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":995
11043  * B_data = &B_data_mv[0]
11044  * B_indices = &B_indices_mv[0]
11045  * B_index_pointer = &B_index_pointer_mv[0] # <<<<<<<<<<<<<<
11046  *
11047  * # Create a linear operator object
11048  */
11049  __Pyx_TraceLine(995,0,__PYX_ERR(0, 995, __pyx_L1_error))
11050  __pyx_t_10 = 0;
11051  __pyx_v_B_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_B_index_pointer_mv.data + __pyx_t_10 * __pyx_v_B_index_pointer_mv.strides[0]) ))));
11052 
11053  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":992
11054  * cdef LongIndexType* B_index_pointer = NULL
11055  *
11056  * if not B_is_identity: # <<<<<<<<<<<<<<
11057  * B_data = &B_data_mv[0]
11058  * B_indices = &B_indices_mv[0]
11059  */
11060  }
11061 
11062  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":998
11063  *
11064  * # Create a linear operator object
11065  * if B_is_identity: # <<<<<<<<<<<<<<
11066  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double](
11067  * A_data,
11068  */
11069  __Pyx_TraceLine(998,0,__PYX_ERR(0, 998, __pyx_L1_error))
11070  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_B_is_identity); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
11071  if (__pyx_t_8) {
11072 
11073  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":999
11074  * # Create a linear operator object
11075  * if B_is_identity:
11076  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
11077  * A_data,
11078  * A_indices,
11079  */
11080  __Pyx_TraceLine(999,0,__PYX_ERR(0, 999, __pyx_L1_error))
11081  try {
11082  __pyx_t_11 = new cCSCAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
11083  } catch(...) {
11084  __Pyx_CppExn2PyErr();
11085  __PYX_ERR(0, 999, __pyx_L1_error)
11086  }
11087  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11088 
11089  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":998
11090  *
11091  * # Create a linear operator object
11092  * if B_is_identity: # <<<<<<<<<<<<<<
11093  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double](
11094  * A_data,
11095  */
11096  goto __pyx_L5;
11097  }
11098 
11099  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1006
11100  * A_num_columns)
11101  * else:
11102  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
11103  * A_data,
11104  * A_indices,
11105  */
11106  __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11107  /*else*/ {
11108 
11109  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1014
11110  * B_data,
11111  * B_indices,
11112  * B_index_pointer) # <<<<<<<<<<<<<<
11113  */
11114  __Pyx_TraceLine(1014,0,__PYX_ERR(0, 1014, __pyx_L1_error))
11115  try {
11116  __pyx_t_11 = new cCSCAffineMatrixFunction<long double> (__pyx_v_A_data, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_B_data, __pyx_v_B_indices, __pyx_v_B_index_pointer);
11117  } catch(...) {
11118  __Pyx_CppExn2PyErr();
11119  __PYX_ERR(0, 1006, __pyx_L1_error)
11120  }
11121 
11122  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1006
11123  * A_num_columns)
11124  * else:
11125  * self.Aop_long_double = new cCSCAffineMatrixFunction[long double]( # <<<<<<<<<<<<<<
11126  * A_data,
11127  * A_indices,
11128  */
11129  __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
11130  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_11;
11131  }
11132  __pyx_L5:;
11133 
11134  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
11135  * # ==========================
11136  *
11137  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
11138  * """
11139  * """
11140  */
11141 
11142  /* function exit code */
11143  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11144  goto __pyx_L0;
11145  __pyx_L1_error:;
11146  __Pyx_XDECREF(__pyx_t_1);
11147  __Pyx_XDECREF(__pyx_t_2);
11148  __Pyx_XDECREF(__pyx_t_4);
11149  __Pyx_XDECREF(__pyx_t_5);
11150  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
11151  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
11152  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
11153  __pyx_r = NULL;
11154  __pyx_L0:;
11155  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_mv, 1);
11156  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
11157  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
11158  __PYX_XDEC_MEMVIEW(&__pyx_v_B_data_mv, 1);
11159  __PYX_XDEC_MEMVIEW(&__pyx_v_B_indices_mv, 1);
11160  __PYX_XDEC_MEMVIEW(&__pyx_v_B_index_pointer_mv, 1);
11161  __Pyx_XGIVEREF(__pyx_r);
11162  __Pyx_TraceReturn(__pyx_r, 0);
11163  __Pyx_RefNannyFinishContext();
11164  return __pyx_r;
11165 }
11166 
11167 /* "(tree fragment)":1
11168  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11169  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11170  * def __setstate_cython__(self, __pyx_state):
11171  */
11172 
11173 /* Python wrapper */
11174 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11175 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__[] = "pycAffineMatrixFunction.__reduce_cython__(self)";
11176 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__};
11177 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11178  PyObject *__pyx_r = 0;
11179  __Pyx_RefNannyDeclarations
11180  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11181  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self));
11182 
11183  /* function exit code */
11184  __Pyx_RefNannyFinishContext();
11185  return __pyx_r;
11186 }
11187 
11188 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self) {
11189  PyObject *__pyx_r = NULL;
11190  __Pyx_TraceDeclarations
11191  __Pyx_RefNannyDeclarations
11192  PyObject *__pyx_t_1 = NULL;
11193  int __pyx_lineno = 0;
11194  const char *__pyx_filename = NULL;
11195  int __pyx_clineno = 0;
11196  __Pyx_TraceFrameInit(__pyx_codeobj__18)
11197  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11198  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
11199 
11200  /* "(tree fragment)":2
11201  * def __reduce_cython__(self):
11202  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11203  * def __setstate_cython__(self, __pyx_state):
11204  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11205  */
11206  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
11207  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11208  __Pyx_GOTREF(__pyx_t_1);
11209  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11210  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11211  __PYX_ERR(1, 2, __pyx_L1_error)
11212 
11213  /* "(tree fragment)":1
11214  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11215  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11216  * def __setstate_cython__(self, __pyx_state):
11217  */
11218 
11219  /* function exit code */
11220  __pyx_L1_error:;
11221  __Pyx_XDECREF(__pyx_t_1);
11222  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11223  __pyx_r = NULL;
11224  __Pyx_XGIVEREF(__pyx_r);
11225  __Pyx_TraceReturn(__pyx_r, 0);
11226  __Pyx_RefNannyFinishContext();
11227  return __pyx_r;
11228 }
11229 
11230 /* "(tree fragment)":3
11231  * def __reduce_cython__(self):
11232  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11233  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11234  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11235  */
11236 
11237 /* Python wrapper */
11238 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11239 static char __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__[] = "pycAffineMatrixFunction.__setstate_cython__(self, __pyx_state)";
11240 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__};
11241 static PyObject *__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11242  PyObject *__pyx_r = 0;
11243  __Pyx_RefNannyDeclarations
11244  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11245  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11246 
11247  /* function exit code */
11248  __Pyx_RefNannyFinishContext();
11249  return __pyx_r;
11250 }
11251 
11252 static PyObject *__pyx_pf_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11253  PyObject *__pyx_r = NULL;
11254  __Pyx_TraceDeclarations
11255  __Pyx_RefNannyDeclarations
11256  PyObject *__pyx_t_1 = NULL;
11257  int __pyx_lineno = 0;
11258  const char *__pyx_filename = NULL;
11259  int __pyx_clineno = 0;
11260  __Pyx_TraceFrameInit(__pyx_codeobj__20)
11261  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11262  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
11263 
11264  /* "(tree fragment)":4
11265  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11266  * def __setstate_cython__(self, __pyx_state):
11267  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11268  */
11269  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
11270  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11271  __Pyx_GOTREF(__pyx_t_1);
11272  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11274  __PYX_ERR(1, 4, __pyx_L1_error)
11275 
11276  /* "(tree fragment)":3
11277  * def __reduce_cython__(self):
11278  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11279  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11280  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11281  */
11282 
11283  /* function exit code */
11284  __pyx_L1_error:;
11285  __Pyx_XDECREF(__pyx_t_1);
11286  __Pyx_AddTraceback("imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11287  __pyx_r = NULL;
11288  __Pyx_XGIVEREF(__pyx_r);
11289  __Pyx_TraceReturn(__pyx_r, 0);
11290  __Pyx_RefNannyFinishContext();
11291  return __pyx_r;
11292 }
11293 
11294 /* "View.MemoryView":122
11295  * cdef bint dtype_is_object
11296  *
11297  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
11298  * mode="c", bint allocate_buffer=True):
11299  *
11300  */
11301 
11302 /* Python wrapper */
11303 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11304 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11305  PyObject *__pyx_v_shape = 0;
11306  Py_ssize_t __pyx_v_itemsize;
11307  PyObject *__pyx_v_format = 0;
11308  PyObject *__pyx_v_mode = 0;
11309  int __pyx_v_allocate_buffer;
11310  int __pyx_lineno = 0;
11311  const char *__pyx_filename = NULL;
11312  int __pyx_clineno = 0;
11313  int __pyx_r;
11314  __Pyx_RefNannyDeclarations
11315  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11316  {
11317  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
11318  PyObject* values[5] = {0,0,0,0,0};
11319  values[3] = ((PyObject *)__pyx_n_s_c);
11320  if (unlikely(__pyx_kwds)) {
11321  Py_ssize_t kw_args;
11322  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11323  switch (pos_args) {
11324  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11325  CYTHON_FALLTHROUGH;
11326  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11327  CYTHON_FALLTHROUGH;
11328  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11329  CYTHON_FALLTHROUGH;
11330  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11331  CYTHON_FALLTHROUGH;
11332  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11333  CYTHON_FALLTHROUGH;
11334  case 0: break;
11335  default: goto __pyx_L5_argtuple_error;
11336  }
11337  kw_args = PyDict_Size(__pyx_kwds);
11338  switch (pos_args) {
11339  case 0:
11340  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
11341  else goto __pyx_L5_argtuple_error;
11342  CYTHON_FALLTHROUGH;
11343  case 1:
11344  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
11345  else {
11346  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
11347  }
11348  CYTHON_FALLTHROUGH;
11349  case 2:
11350  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
11351  else {
11352  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
11353  }
11354  CYTHON_FALLTHROUGH;
11355  case 3:
11356  if (kw_args > 0) {
11357  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
11358  if (value) { values[3] = value; kw_args--; }
11359  }
11360  CYTHON_FALLTHROUGH;
11361  case 4:
11362  if (kw_args > 0) {
11363  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
11364  if (value) { values[4] = value; kw_args--; }
11365  }
11366  }
11367  if (unlikely(kw_args > 0)) {
11368  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
11369  }
11370  } else {
11371  switch (PyTuple_GET_SIZE(__pyx_args)) {
11372  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11373  CYTHON_FALLTHROUGH;
11374  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11375  CYTHON_FALLTHROUGH;
11376  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11377  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11378  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11379  break;
11380  default: goto __pyx_L5_argtuple_error;
11381  }
11382  }
11383  __pyx_v_shape = ((PyObject*)values[0]);
11384  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
11385  __pyx_v_format = values[2];
11386  __pyx_v_mode = values[3];
11387  if (values[4]) {
11388  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
11389  } else {
11390 
11391  /* "View.MemoryView":123
11392  *
11393  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
11394  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
11395  *
11396  * cdef int idx
11397  */
11398  __pyx_v_allocate_buffer = ((int)1);
11399  }
11400  }
11401  goto __pyx_L4_argument_unpacking_done;
11402  __pyx_L5_argtuple_error:;
11403  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
11404  __pyx_L3_error:;
11405  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11406  __Pyx_RefNannyFinishContext();
11407  return -1;
11408  __pyx_L4_argument_unpacking_done:;
11409  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
11410  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
11411  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
11412  }
11413  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
11414 
11415  /* "View.MemoryView":122
11416  * cdef bint dtype_is_object
11417  *
11418  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
11419  * mode="c", bint allocate_buffer=True):
11420  *
11421  */
11422 
11423  /* function exit code */
11424  goto __pyx_L0;
11425  __pyx_L1_error:;
11426  __pyx_r = -1;
11427  __pyx_L0:;
11428  __Pyx_RefNannyFinishContext();
11429  return __pyx_r;
11430 }
11431 
11432 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
11433  int __pyx_v_idx;
11434  Py_ssize_t __pyx_v_i;
11435  Py_ssize_t __pyx_v_dim;
11436  PyObject **__pyx_v_p;
11437  char __pyx_v_order;
11438  int __pyx_r;
11439  __Pyx_TraceDeclarations
11440  __Pyx_RefNannyDeclarations
11441  Py_ssize_t __pyx_t_1;
11442  int __pyx_t_2;
11443  PyObject *__pyx_t_3 = NULL;
11444  int __pyx_t_4;
11445  PyObject *__pyx_t_5 = NULL;
11446  PyObject *__pyx_t_6 = NULL;
11447  char *__pyx_t_7;
11448  int __pyx_t_8;
11449  Py_ssize_t __pyx_t_9;
11450  PyObject *__pyx_t_10 = NULL;
11451  Py_ssize_t __pyx_t_11;
11452  int __pyx_lineno = 0;
11453  const char *__pyx_filename = NULL;
11454  int __pyx_clineno = 0;
11455  __Pyx_RefNannySetupContext("__cinit__", 0);
11456  __Pyx_TraceCall("__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
11457  __Pyx_INCREF(__pyx_v_format);
11458 
11459  /* "View.MemoryView":129
11460  * cdef PyObject **p
11461  *
11462  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
11463  * self.itemsize = itemsize
11464  *
11465  */
11466  __Pyx_TraceLine(129,0,__PYX_ERR(1, 129, __pyx_L1_error))
11467  if (unlikely(__pyx_v_shape == Py_None)) {
11468  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
11469  __PYX_ERR(1, 129, __pyx_L1_error)
11470  }
11471  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
11472  __pyx_v_self->ndim = ((int)__pyx_t_1);
11473 
11474  /* "View.MemoryView":130
11475  *
11476  * self.ndim = <int> len(shape)
11477  * self.itemsize = itemsize # <<<<<<<<<<<<<<
11478  *
11479  * if not self.ndim:
11480  */
11481  __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
11482  __pyx_v_self->itemsize = __pyx_v_itemsize;
11483 
11484  /* "View.MemoryView":132
11485  * self.itemsize = itemsize
11486  *
11487  * if not self.ndim: # <<<<<<<<<<<<<<
11488  * raise ValueError("Empty shape tuple for cython.array")
11489  *
11490  */
11491  __Pyx_TraceLine(132,0,__PYX_ERR(1, 132, __pyx_L1_error))
11492  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
11493  if (unlikely(__pyx_t_2)) {
11494 
11495  /* "View.MemoryView":133
11496  *
11497  * if not self.ndim:
11498  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
11499  *
11500  * if itemsize <= 0:
11501  */
11502  __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
11503  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
11504  __Pyx_GOTREF(__pyx_t_3);
11505  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11506  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11507  __PYX_ERR(1, 133, __pyx_L1_error)
11508 
11509  /* "View.MemoryView":132
11510  * self.itemsize = itemsize
11511  *
11512  * if not self.ndim: # <<<<<<<<<<<<<<
11513  * raise ValueError("Empty shape tuple for cython.array")
11514  *
11515  */
11516  }
11517 
11518  /* "View.MemoryView":135
11519  * raise ValueError("Empty shape tuple for cython.array")
11520  *
11521  * if itemsize <= 0: # <<<<<<<<<<<<<<
11522  * raise ValueError("itemsize <= 0 for cython.array")
11523  *
11524  */
11525  __Pyx_TraceLine(135,0,__PYX_ERR(1, 135, __pyx_L1_error))
11526  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
11527  if (unlikely(__pyx_t_2)) {
11528 
11529  /* "View.MemoryView":136
11530  *
11531  * if itemsize <= 0:
11532  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
11533  *
11534  * if not isinstance(format, bytes):
11535  */
11536  __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
11537  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
11538  __Pyx_GOTREF(__pyx_t_3);
11539  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11540  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11541  __PYX_ERR(1, 136, __pyx_L1_error)
11542 
11543  /* "View.MemoryView":135
11544  * raise ValueError("Empty shape tuple for cython.array")
11545  *
11546  * if itemsize <= 0: # <<<<<<<<<<<<<<
11547  * raise ValueError("itemsize <= 0 for cython.array")
11548  *
11549  */
11550  }
11551 
11552  /* "View.MemoryView":138
11553  * raise ValueError("itemsize <= 0 for cython.array")
11554  *
11555  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
11556  * format = format.encode('ASCII')
11557  * self._format = format # keep a reference to the byte string
11558  */
11559  __Pyx_TraceLine(138,0,__PYX_ERR(1, 138, __pyx_L1_error))
11560  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
11561  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
11562  if (__pyx_t_4) {
11563 
11564  /* "View.MemoryView":139
11565  *
11566  * if not isinstance(format, bytes):
11567  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
11568  * self._format = format # keep a reference to the byte string
11569  * self.format = self._format
11570  */
11571  __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
11572  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
11573  __Pyx_GOTREF(__pyx_t_5);
11574  __pyx_t_6 = NULL;
11575  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11576  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11577  if (likely(__pyx_t_6)) {
11578  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11579  __Pyx_INCREF(__pyx_t_6);
11580  __Pyx_INCREF(function);
11581  __Pyx_DECREF_SET(__pyx_t_5, function);
11582  }
11583  }
11584  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
11585  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11586  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
11587  __Pyx_GOTREF(__pyx_t_3);
11588  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11589  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
11590  __pyx_t_3 = 0;
11591 
11592  /* "View.MemoryView":138
11593  * raise ValueError("itemsize <= 0 for cython.array")
11594  *
11595  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
11596  * format = format.encode('ASCII')
11597  * self._format = format # keep a reference to the byte string
11598  */
11599  }
11600 
11601  /* "View.MemoryView":140
11602  * if not isinstance(format, bytes):
11603  * format = format.encode('ASCII')
11604  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
11605  * self.format = self._format
11606  *
11607  */
11608  __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
11609  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
11610  __pyx_t_3 = __pyx_v_format;
11611  __Pyx_INCREF(__pyx_t_3);
11612  __Pyx_GIVEREF(__pyx_t_3);
11613  __Pyx_GOTREF(__pyx_v_self->_format);
11614  __Pyx_DECREF(__pyx_v_self->_format);
11615  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
11616  __pyx_t_3 = 0;
11617 
11618  /* "View.MemoryView":141
11619  * format = format.encode('ASCII')
11620  * self._format = format # keep a reference to the byte string
11621  * self.format = self._format # <<<<<<<<<<<<<<
11622  *
11623  *
11624  */
11625  __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
11626  if (unlikely(__pyx_v_self->_format == Py_None)) {
11627  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
11628  __PYX_ERR(1, 141, __pyx_L1_error)
11629  }
11630  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
11631  __pyx_v_self->format = __pyx_t_7;
11632 
11633  /* "View.MemoryView":144
11634  *
11635  *
11636  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
11637  * self._strides = self._shape + self.ndim
11638  *
11639  */
11640  __Pyx_TraceLine(144,0,__PYX_ERR(1, 144, __pyx_L1_error))
11641  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
11642 
11643  /* "View.MemoryView":145
11644  *
11645  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
11646  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
11647  *
11648  * if not self._shape:
11649  */
11650  __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
11651  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
11652 
11653  /* "View.MemoryView":147
11654  * self._strides = self._shape + self.ndim
11655  *
11656  * if not self._shape: # <<<<<<<<<<<<<<
11657  * raise MemoryError("unable to allocate shape and strides.")
11658  *
11659  */
11660  __Pyx_TraceLine(147,0,__PYX_ERR(1, 147, __pyx_L1_error))
11661  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
11662  if (unlikely(__pyx_t_4)) {
11663 
11664  /* "View.MemoryView":148
11665  *
11666  * if not self._shape:
11667  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
11668  *
11669  *
11670  */
11671  __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
11672  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
11673  __Pyx_GOTREF(__pyx_t_3);
11674  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11675  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11676  __PYX_ERR(1, 148, __pyx_L1_error)
11677 
11678  /* "View.MemoryView":147
11679  * self._strides = self._shape + self.ndim
11680  *
11681  * if not self._shape: # <<<<<<<<<<<<<<
11682  * raise MemoryError("unable to allocate shape and strides.")
11683  *
11684  */
11685  }
11686 
11687  /* "View.MemoryView":151
11688  *
11689  *
11690  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
11691  * if dim <= 0:
11692  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11693  */
11694  __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
11695  __pyx_t_8 = 0;
11696  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
11697  for (;;) {
11698  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
11699  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11700  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
11701  #else
11702  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
11703  __Pyx_GOTREF(__pyx_t_5);
11704  #endif
11705  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
11706  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11707  __pyx_v_dim = __pyx_t_9;
11708  __pyx_v_idx = __pyx_t_8;
11709  __pyx_t_8 = (__pyx_t_8 + 1);
11710 
11711  /* "View.MemoryView":152
11712  *
11713  * for idx, dim in enumerate(shape):
11714  * if dim <= 0: # <<<<<<<<<<<<<<
11715  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11716  * self._shape[idx] = dim
11717  */
11718  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
11719  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
11720  if (unlikely(__pyx_t_4)) {
11721 
11722  /* "View.MemoryView":153
11723  * for idx, dim in enumerate(shape):
11724  * if dim <= 0:
11725  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
11726  * self._shape[idx] = dim
11727  *
11728  */
11729  __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
11730  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
11731  __Pyx_GOTREF(__pyx_t_5);
11732  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
11733  __Pyx_GOTREF(__pyx_t_6);
11734  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
11735  __Pyx_GOTREF(__pyx_t_10);
11736  __Pyx_GIVEREF(__pyx_t_5);
11737  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
11738  __Pyx_GIVEREF(__pyx_t_6);
11739  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
11740  __pyx_t_5 = 0;
11741  __pyx_t_6 = 0;
11742  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
11743  __Pyx_GOTREF(__pyx_t_6);
11744  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11745  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
11746  __Pyx_GOTREF(__pyx_t_10);
11747  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11748  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11749  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11750  __PYX_ERR(1, 153, __pyx_L1_error)
11751 
11752  /* "View.MemoryView":152
11753  *
11754  * for idx, dim in enumerate(shape):
11755  * if dim <= 0: # <<<<<<<<<<<<<<
11756  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11757  * self._shape[idx] = dim
11758  */
11759  }
11760 
11761  /* "View.MemoryView":154
11762  * if dim <= 0:
11763  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11764  * self._shape[idx] = dim # <<<<<<<<<<<<<<
11765  *
11766  * cdef char order
11767  */
11768  __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
11769  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
11770 
11771  /* "View.MemoryView":151
11772  *
11773  *
11774  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
11775  * if dim <= 0:
11776  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11777  */
11778  __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
11779  }
11780  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11781 
11782  /* "View.MemoryView":157
11783  *
11784  * cdef char order
11785  * if mode == 'fortran': # <<<<<<<<<<<<<<
11786  * order = b'F'
11787  * self.mode = u'fortran'
11788  */
11789  __Pyx_TraceLine(157,0,__PYX_ERR(1, 157, __pyx_L1_error))
11790  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
11791  if (__pyx_t_4) {
11792 
11793  /* "View.MemoryView":158
11794  * cdef char order
11795  * if mode == 'fortran':
11796  * order = b'F' # <<<<<<<<<<<<<<
11797  * self.mode = u'fortran'
11798  * elif mode == 'c':
11799  */
11800  __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
11801  __pyx_v_order = 'F';
11802 
11803  /* "View.MemoryView":159
11804  * if mode == 'fortran':
11805  * order = b'F'
11806  * self.mode = u'fortran' # <<<<<<<<<<<<<<
11807  * elif mode == 'c':
11808  * order = b'C'
11809  */
11810  __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
11811  __Pyx_INCREF(__pyx_n_u_fortran);
11812  __Pyx_GIVEREF(__pyx_n_u_fortran);
11813  __Pyx_GOTREF(__pyx_v_self->mode);
11814  __Pyx_DECREF(__pyx_v_self->mode);
11815  __pyx_v_self->mode = __pyx_n_u_fortran;
11816 
11817  /* "View.MemoryView":157
11818  *
11819  * cdef char order
11820  * if mode == 'fortran': # <<<<<<<<<<<<<<
11821  * order = b'F'
11822  * self.mode = u'fortran'
11823  */
11824  goto __pyx_L10;
11825  }
11826 
11827  /* "View.MemoryView":160
11828  * order = b'F'
11829  * self.mode = u'fortran'
11830  * elif mode == 'c': # <<<<<<<<<<<<<<
11831  * order = b'C'
11832  * self.mode = u'c'
11833  */
11834  __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
11835  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
11836  if (likely(__pyx_t_4)) {
11837 
11838  /* "View.MemoryView":161
11839  * self.mode = u'fortran'
11840  * elif mode == 'c':
11841  * order = b'C' # <<<<<<<<<<<<<<
11842  * self.mode = u'c'
11843  * else:
11844  */
11845  __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
11846  __pyx_v_order = 'C';
11847 
11848  /* "View.MemoryView":162
11849  * elif mode == 'c':
11850  * order = b'C'
11851  * self.mode = u'c' # <<<<<<<<<<<<<<
11852  * else:
11853  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
11854  */
11855  __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
11856  __Pyx_INCREF(__pyx_n_u_c);
11857  __Pyx_GIVEREF(__pyx_n_u_c);
11858  __Pyx_GOTREF(__pyx_v_self->mode);
11859  __Pyx_DECREF(__pyx_v_self->mode);
11860  __pyx_v_self->mode = __pyx_n_u_c;
11861 
11862  /* "View.MemoryView":160
11863  * order = b'F'
11864  * self.mode = u'fortran'
11865  * elif mode == 'c': # <<<<<<<<<<<<<<
11866  * order = b'C'
11867  * self.mode = u'c'
11868  */
11869  goto __pyx_L10;
11870  }
11871 
11872  /* "View.MemoryView":164
11873  * self.mode = u'c'
11874  * else:
11875  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
11876  *
11877  * self.len = fill_contig_strides_array(self._shape, self._strides,
11878  */
11879  __Pyx_TraceLine(164,0,__PYX_ERR(1, 164, __pyx_L1_error))
11880  /*else*/ {
11881  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
11882  __Pyx_GOTREF(__pyx_t_3);
11883  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
11884  __Pyx_GOTREF(__pyx_t_10);
11885  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11886  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11887  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11888  __PYX_ERR(1, 164, __pyx_L1_error)
11889  }
11890  __pyx_L10:;
11891 
11892  /* "View.MemoryView":166
11893  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
11894  *
11895  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
11896  * itemsize, self.ndim, order)
11897  *
11898  */
11899  __Pyx_TraceLine(166,0,__PYX_ERR(1, 166, __pyx_L1_error))
11900  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
11901 
11902  /* "View.MemoryView":169
11903  * itemsize, self.ndim, order)
11904  *
11905  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
11906  * self.dtype_is_object = format == b'O'
11907  * if allocate_buffer:
11908  */
11909  __Pyx_TraceLine(169,0,__PYX_ERR(1, 169, __pyx_L1_error))
11910  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
11911 
11912  /* "View.MemoryView":170
11913  *
11914  * self.free_data = allocate_buffer
11915  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
11916  * if allocate_buffer:
11917  *
11918  */
11919  __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
11920  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
11921  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
11922  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11923  __pyx_v_self->dtype_is_object = __pyx_t_4;
11924 
11925  /* "View.MemoryView":171
11926  * self.free_data = allocate_buffer
11927  * self.dtype_is_object = format == b'O'
11928  * if allocate_buffer: # <<<<<<<<<<<<<<
11929  *
11930  *
11931  */
11932  __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
11933  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
11934  if (__pyx_t_4) {
11935 
11936  /* "View.MemoryView":174
11937  *
11938  *
11939  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
11940  * if not self.data:
11941  * raise MemoryError("unable to allocate array data.")
11942  */
11943  __Pyx_TraceLine(174,0,__PYX_ERR(1, 174, __pyx_L1_error))
11944  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
11945 
11946  /* "View.MemoryView":175
11947  *
11948  * self.data = <char *>malloc(self.len)
11949  * if not self.data: # <<<<<<<<<<<<<<
11950  * raise MemoryError("unable to allocate array data.")
11951  *
11952  */
11953  __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
11954  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
11955  if (unlikely(__pyx_t_4)) {
11956 
11957  /* "View.MemoryView":176
11958  * self.data = <char *>malloc(self.len)
11959  * if not self.data:
11960  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
11961  *
11962  * if self.dtype_is_object:
11963  */
11964  __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
11965  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
11966  __Pyx_GOTREF(__pyx_t_10);
11967  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11968  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11969  __PYX_ERR(1, 176, __pyx_L1_error)
11970 
11971  /* "View.MemoryView":175
11972  *
11973  * self.data = <char *>malloc(self.len)
11974  * if not self.data: # <<<<<<<<<<<<<<
11975  * raise MemoryError("unable to allocate array data.")
11976  *
11977  */
11978  }
11979 
11980  /* "View.MemoryView":178
11981  * raise MemoryError("unable to allocate array data.")
11982  *
11983  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11984  * p = <PyObject **> self.data
11985  * for i in range(self.len / itemsize):
11986  */
11987  __Pyx_TraceLine(178,0,__PYX_ERR(1, 178, __pyx_L1_error))
11988  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
11989  if (__pyx_t_4) {
11990 
11991  /* "View.MemoryView":179
11992  *
11993  * if self.dtype_is_object:
11994  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
11995  * for i in range(self.len / itemsize):
11996  * p[i] = Py_None
11997  */
11998  __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
11999  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
12000 
12001  /* "View.MemoryView":180
12002  * if self.dtype_is_object:
12003  * p = <PyObject **> self.data
12004  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
12005  * p[i] = Py_None
12006  * Py_INCREF(Py_None)
12007  */
12008  __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
12009  if (unlikely(__pyx_v_itemsize == 0)) {
12010  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
12011  __PYX_ERR(1, 180, __pyx_L1_error)
12012  }
12013  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
12014  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
12015  __PYX_ERR(1, 180, __pyx_L1_error)
12016  }
12017  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
12018  __pyx_t_9 = __pyx_t_1;
12019  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
12020  __pyx_v_i = __pyx_t_11;
12021 
12022  /* "View.MemoryView":181
12023  * p = <PyObject **> self.data
12024  * for i in range(self.len / itemsize):
12025  * p[i] = Py_None # <<<<<<<<<<<<<<
12026  * Py_INCREF(Py_None)
12027  *
12028  */
12029  __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
12030  (__pyx_v_p[__pyx_v_i]) = Py_None;
12031 
12032  /* "View.MemoryView":182
12033  * for i in range(self.len / itemsize):
12034  * p[i] = Py_None
12035  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
12036  *
12037  * @cname('getbuffer')
12038  */
12039  __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
12040  Py_INCREF(Py_None);
12041  }
12042 
12043  /* "View.MemoryView":178
12044  * raise MemoryError("unable to allocate array data.")
12045  *
12046  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12047  * p = <PyObject **> self.data
12048  * for i in range(self.len / itemsize):
12049  */
12050  }
12051 
12052  /* "View.MemoryView":171
12053  * self.free_data = allocate_buffer
12054  * self.dtype_is_object = format == b'O'
12055  * if allocate_buffer: # <<<<<<<<<<<<<<
12056  *
12057  *
12058  */
12059  }
12060 
12061  /* "View.MemoryView":122
12062  * cdef bint dtype_is_object
12063  *
12064  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
12065  * mode="c", bint allocate_buffer=True):
12066  *
12067  */
12068 
12069  /* function exit code */
12070  __pyx_r = 0;
12071  goto __pyx_L0;
12072  __pyx_L1_error:;
12073  __Pyx_XDECREF(__pyx_t_3);
12074  __Pyx_XDECREF(__pyx_t_5);
12075  __Pyx_XDECREF(__pyx_t_6);
12076  __Pyx_XDECREF(__pyx_t_10);
12077  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12078  __pyx_r = -1;
12079  __pyx_L0:;
12080  __Pyx_XDECREF(__pyx_v_format);
12081  __Pyx_TraceReturn(Py_None, 0);
12082  __Pyx_RefNannyFinishContext();
12083  return __pyx_r;
12084 }
12085 
12086 /* "View.MemoryView":185
12087  *
12088  * @cname('getbuffer')
12089  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12090  * cdef int bufmode = -1
12091  * if self.mode == u"c":
12092  */
12093 
12094 /* Python wrapper */
12095 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12096 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12097  int __pyx_r;
12098  __Pyx_RefNannyDeclarations
12099  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12100  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12101 
12102  /* function exit code */
12103  __Pyx_RefNannyFinishContext();
12104  return __pyx_r;
12105 }
12106 
12107 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12108  int __pyx_v_bufmode;
12109  int __pyx_r;
12110  __Pyx_TraceDeclarations
12111  __Pyx_RefNannyDeclarations
12112  int __pyx_t_1;
12113  int __pyx_t_2;
12114  PyObject *__pyx_t_3 = NULL;
12115  char *__pyx_t_4;
12116  Py_ssize_t __pyx_t_5;
12117  int __pyx_t_6;
12118  Py_ssize_t *__pyx_t_7;
12119  int __pyx_lineno = 0;
12120  const char *__pyx_filename = NULL;
12121  int __pyx_clineno = 0;
12122  if (__pyx_v_info == NULL) {
12123  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12124  return -1;
12125  }
12126  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12127  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12128  __Pyx_GIVEREF(__pyx_v_info->obj);
12129  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
12130 
12131  /* "View.MemoryView":186
12132  * @cname('getbuffer')
12133  * def __getbuffer__(self, Py_buffer *info, int flags):
12134  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
12135  * if self.mode == u"c":
12136  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12137  */
12138  __Pyx_TraceLine(186,0,__PYX_ERR(1, 186, __pyx_L1_error))
12139  __pyx_v_bufmode = -1;
12140 
12141  /* "View.MemoryView":187
12142  * def __getbuffer__(self, Py_buffer *info, int flags):
12143  * cdef int bufmode = -1
12144  * if self.mode == u"c": # <<<<<<<<<<<<<<
12145  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12146  * elif self.mode == u"fortran":
12147  */
12148  __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
12149  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
12150  __pyx_t_2 = (__pyx_t_1 != 0);
12151  if (__pyx_t_2) {
12152 
12153  /* "View.MemoryView":188
12154  * cdef int bufmode = -1
12155  * if self.mode == u"c":
12156  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
12157  * elif self.mode == u"fortran":
12158  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12159  */
12160  __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
12161  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12162 
12163  /* "View.MemoryView":187
12164  * def __getbuffer__(self, Py_buffer *info, int flags):
12165  * cdef int bufmode = -1
12166  * if self.mode == u"c": # <<<<<<<<<<<<<<
12167  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12168  * elif self.mode == u"fortran":
12169  */
12170  goto __pyx_L3;
12171  }
12172 
12173  /* "View.MemoryView":189
12174  * if self.mode == u"c":
12175  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12176  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
12177  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12178  * if not (flags & bufmode):
12179  */
12180  __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
12181  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
12182  __pyx_t_1 = (__pyx_t_2 != 0);
12183  if (__pyx_t_1) {
12184 
12185  /* "View.MemoryView":190
12186  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12187  * elif self.mode == u"fortran":
12188  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
12189  * if not (flags & bufmode):
12190  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12191  */
12192  __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
12193  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12194 
12195  /* "View.MemoryView":189
12196  * if self.mode == u"c":
12197  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12198  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
12199  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12200  * if not (flags & bufmode):
12201  */
12202  }
12203  __pyx_L3:;
12204 
12205  /* "View.MemoryView":191
12206  * elif self.mode == u"fortran":
12207  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12208  * if not (flags & bufmode): # <<<<<<<<<<<<<<
12209  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12210  * info.buf = self.data
12211  */
12212  __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
12213  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
12214  if (unlikely(__pyx_t_1)) {
12215 
12216  /* "View.MemoryView":192
12217  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12218  * if not (flags & bufmode):
12219  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
12220  * info.buf = self.data
12221  * info.len = self.len
12222  */
12223  __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
12224  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
12225  __Pyx_GOTREF(__pyx_t_3);
12226  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12227  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12228  __PYX_ERR(1, 192, __pyx_L1_error)
12229 
12230  /* "View.MemoryView":191
12231  * elif self.mode == u"fortran":
12232  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12233  * if not (flags & bufmode): # <<<<<<<<<<<<<<
12234  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12235  * info.buf = self.data
12236  */
12237  }
12238 
12239  /* "View.MemoryView":193
12240  * if not (flags & bufmode):
12241  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12242  * info.buf = self.data # <<<<<<<<<<<<<<
12243  * info.len = self.len
12244  * info.ndim = self.ndim
12245  */
12246  __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
12247  __pyx_t_4 = __pyx_v_self->data;
12248  __pyx_v_info->buf = __pyx_t_4;
12249 
12250  /* "View.MemoryView":194
12251  * raise ValueError("Can only create a buffer that is contiguous in memory.")
12252  * info.buf = self.data
12253  * info.len = self.len # <<<<<<<<<<<<<<
12254  * info.ndim = self.ndim
12255  * info.shape = self._shape
12256  */
12257  __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
12258  __pyx_t_5 = __pyx_v_self->len;
12259  __pyx_v_info->len = __pyx_t_5;
12260 
12261  /* "View.MemoryView":195
12262  * info.buf = self.data
12263  * info.len = self.len
12264  * info.ndim = self.ndim # <<<<<<<<<<<<<<
12265  * info.shape = self._shape
12266  * info.strides = self._strides
12267  */
12268  __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
12269  __pyx_t_6 = __pyx_v_self->ndim;
12270  __pyx_v_info->ndim = __pyx_t_6;
12271 
12272  /* "View.MemoryView":196
12273  * info.len = self.len
12274  * info.ndim = self.ndim
12275  * info.shape = self._shape # <<<<<<<<<<<<<<
12276  * info.strides = self._strides
12277  * info.suboffsets = NULL
12278  */
12279  __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
12280  __pyx_t_7 = __pyx_v_self->_shape;
12281  __pyx_v_info->shape = __pyx_t_7;
12282 
12283  /* "View.MemoryView":197
12284  * info.ndim = self.ndim
12285  * info.shape = self._shape
12286  * info.strides = self._strides # <<<<<<<<<<<<<<
12287  * info.suboffsets = NULL
12288  * info.itemsize = self.itemsize
12289  */
12290  __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
12291  __pyx_t_7 = __pyx_v_self->_strides;
12292  __pyx_v_info->strides = __pyx_t_7;
12293 
12294  /* "View.MemoryView":198
12295  * info.shape = self._shape
12296  * info.strides = self._strides
12297  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12298  * info.itemsize = self.itemsize
12299  * info.readonly = 0
12300  */
12301  __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
12302  __pyx_v_info->suboffsets = NULL;
12303 
12304  /* "View.MemoryView":199
12305  * info.strides = self._strides
12306  * info.suboffsets = NULL
12307  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
12308  * info.readonly = 0
12309  *
12310  */
12311  __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
12312  __pyx_t_5 = __pyx_v_self->itemsize;
12313  __pyx_v_info->itemsize = __pyx_t_5;
12314 
12315  /* "View.MemoryView":200
12316  * info.suboffsets = NULL
12317  * info.itemsize = self.itemsize
12318  * info.readonly = 0 # <<<<<<<<<<<<<<
12319  *
12320  * if flags & PyBUF_FORMAT:
12321  */
12322  __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
12323  __pyx_v_info->readonly = 0;
12324 
12325  /* "View.MemoryView":202
12326  * info.readonly = 0
12327  *
12328  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12329  * info.format = self.format
12330  * else:
12331  */
12332  __Pyx_TraceLine(202,0,__PYX_ERR(1, 202, __pyx_L1_error))
12333  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12334  if (__pyx_t_1) {
12335 
12336  /* "View.MemoryView":203
12337  *
12338  * if flags & PyBUF_FORMAT:
12339  * info.format = self.format # <<<<<<<<<<<<<<
12340  * else:
12341  * info.format = NULL
12342  */
12343  __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
12344  __pyx_t_4 = __pyx_v_self->format;
12345  __pyx_v_info->format = __pyx_t_4;
12346 
12347  /* "View.MemoryView":202
12348  * info.readonly = 0
12349  *
12350  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12351  * info.format = self.format
12352  * else:
12353  */
12354  goto __pyx_L5;
12355  }
12356 
12357  /* "View.MemoryView":205
12358  * info.format = self.format
12359  * else:
12360  * info.format = NULL # <<<<<<<<<<<<<<
12361  *
12362  * info.obj = self
12363  */
12364  __Pyx_TraceLine(205,0,__PYX_ERR(1, 205, __pyx_L1_error))
12365  /*else*/ {
12366  __pyx_v_info->format = NULL;
12367  }
12368  __pyx_L5:;
12369 
12370  /* "View.MemoryView":207
12371  * info.format = NULL
12372  *
12373  * info.obj = self # <<<<<<<<<<<<<<
12374  *
12375  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12376  */
12377  __Pyx_TraceLine(207,0,__PYX_ERR(1, 207, __pyx_L1_error))
12378  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12379  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12380  __Pyx_GOTREF(__pyx_v_info->obj);
12381  __Pyx_DECREF(__pyx_v_info->obj);
12382  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12383 
12384  /* "View.MemoryView":185
12385  *
12386  * @cname('getbuffer')
12387  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12388  * cdef int bufmode = -1
12389  * if self.mode == u"c":
12390  */
12391 
12392  /* function exit code */
12393  __pyx_r = 0;
12394  goto __pyx_L0;
12395  __pyx_L1_error:;
12396  __Pyx_XDECREF(__pyx_t_3);
12397  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12398  __pyx_r = -1;
12399  if (__pyx_v_info->obj != NULL) {
12400  __Pyx_GOTREF(__pyx_v_info->obj);
12401  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12402  }
12403  goto __pyx_L2;
12404  __pyx_L0:;
12405  if (__pyx_v_info->obj == Py_None) {
12406  __Pyx_GOTREF(__pyx_v_info->obj);
12407  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12408  }
12409  __pyx_L2:;
12410  __Pyx_TraceReturn(Py_None, 0);
12411  __Pyx_RefNannyFinishContext();
12412  return __pyx_r;
12413 }
12414 
12415 /* "View.MemoryView":211
12416  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12417  *
12418  * def __dealloc__(array self): # <<<<<<<<<<<<<<
12419  * if self.callback_free_data != NULL:
12420  * self.callback_free_data(self.data)
12421  */
12422 
12423 /* Python wrapper */
12424 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
12425 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
12426  __Pyx_RefNannyDeclarations
12427  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
12428  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
12429 
12430  /* function exit code */
12431  __Pyx_RefNannyFinishContext();
12432 }
12433 
12434 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
12435  __Pyx_TraceDeclarations
12436  __Pyx_RefNannyDeclarations
12437  int __pyx_t_1;
12438  int __pyx_lineno = 0;
12439  const char *__pyx_filename = NULL;
12440  int __pyx_clineno = 0;
12441  __Pyx_RefNannySetupContext("__dealloc__", 0);
12442  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
12443 
12444  /* "View.MemoryView":212
12445  *
12446  * def __dealloc__(array self):
12447  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
12448  * self.callback_free_data(self.data)
12449  * elif self.free_data:
12450  */
12451  __Pyx_TraceLine(212,0,__PYX_ERR(1, 212, __pyx_L1_error))
12452  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
12453  if (__pyx_t_1) {
12454 
12455  /* "View.MemoryView":213
12456  * def __dealloc__(array self):
12457  * if self.callback_free_data != NULL:
12458  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
12459  * elif self.free_data:
12460  * if self.dtype_is_object:
12461  */
12462  __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
12463  __pyx_v_self->callback_free_data(__pyx_v_self->data);
12464 
12465  /* "View.MemoryView":212
12466  *
12467  * def __dealloc__(array self):
12468  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
12469  * self.callback_free_data(self.data)
12470  * elif self.free_data:
12471  */
12472  goto __pyx_L3;
12473  }
12474 
12475  /* "View.MemoryView":214
12476  * if self.callback_free_data != NULL:
12477  * self.callback_free_data(self.data)
12478  * elif self.free_data: # <<<<<<<<<<<<<<
12479  * if self.dtype_is_object:
12480  * refcount_objects_in_slice(self.data, self._shape,
12481  */
12482  __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
12483  __pyx_t_1 = (__pyx_v_self->free_data != 0);
12484  if (__pyx_t_1) {
12485 
12486  /* "View.MemoryView":215
12487  * self.callback_free_data(self.data)
12488  * elif self.free_data:
12489  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12490  * refcount_objects_in_slice(self.data, self._shape,
12491  * self._strides, self.ndim, False)
12492  */
12493  __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
12494  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12495  if (__pyx_t_1) {
12496 
12497  /* "View.MemoryView":216
12498  * elif self.free_data:
12499  * if self.dtype_is_object:
12500  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
12501  * self._strides, self.ndim, False)
12502  * free(self.data)
12503  */
12504  __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
12505  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
12506 
12507  /* "View.MemoryView":215
12508  * self.callback_free_data(self.data)
12509  * elif self.free_data:
12510  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12511  * refcount_objects_in_slice(self.data, self._shape,
12512  * self._strides, self.ndim, False)
12513  */
12514  }
12515 
12516  /* "View.MemoryView":218
12517  * refcount_objects_in_slice(self.data, self._shape,
12518  * self._strides, self.ndim, False)
12519  * free(self.data) # <<<<<<<<<<<<<<
12520  * PyObject_Free(self._shape)
12521  *
12522  */
12523  __Pyx_TraceLine(218,0,__PYX_ERR(1, 218, __pyx_L1_error))
12524  free(__pyx_v_self->data);
12525 
12526  /* "View.MemoryView":214
12527  * if self.callback_free_data != NULL:
12528  * self.callback_free_data(self.data)
12529  * elif self.free_data: # <<<<<<<<<<<<<<
12530  * if self.dtype_is_object:
12531  * refcount_objects_in_slice(self.data, self._shape,
12532  */
12533  }
12534  __pyx_L3:;
12535 
12536  /* "View.MemoryView":219
12537  * self._strides, self.ndim, False)
12538  * free(self.data)
12539  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
12540  *
12541  * @property
12542  */
12543  __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
12544  PyObject_Free(__pyx_v_self->_shape);
12545 
12546  /* "View.MemoryView":211
12547  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12548  *
12549  * def __dealloc__(array self): # <<<<<<<<<<<<<<
12550  * if self.callback_free_data != NULL:
12551  * self.callback_free_data(self.data)
12552  */
12553 
12554  /* function exit code */
12555  goto __pyx_L0;
12556  __pyx_L1_error:;
12557  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
12558  __pyx_L0:;
12559  __Pyx_TraceReturn(Py_None, 0);
12560  __Pyx_RefNannyFinishContext();
12561 }
12562 
12563 /* "View.MemoryView":222
12564  *
12565  * @property
12566  * def memview(self): # <<<<<<<<<<<<<<
12567  * return self.get_memview()
12568  *
12569  */
12570 
12571 /* Python wrapper */
12572 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
12573 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
12574  PyObject *__pyx_r = 0;
12575  __Pyx_RefNannyDeclarations
12576  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12577  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
12578 
12579  /* function exit code */
12580  __Pyx_RefNannyFinishContext();
12581  return __pyx_r;
12582 }
12583 
12584 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
12585  PyObject *__pyx_r = NULL;
12586  __Pyx_TraceDeclarations
12587  __Pyx_RefNannyDeclarations
12588  PyObject *__pyx_t_1 = NULL;
12589  int __pyx_lineno = 0;
12590  const char *__pyx_filename = NULL;
12591  int __pyx_clineno = 0;
12592  __Pyx_RefNannySetupContext("__get__", 0);
12593  __Pyx_TraceCall("__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
12594 
12595  /* "View.MemoryView":223
12596  * @property
12597  * def memview(self):
12598  * return self.get_memview() # <<<<<<<<<<<<<<
12599  *
12600  * @cname('get_memview')
12601  */
12602  __Pyx_TraceLine(223,0,__PYX_ERR(1, 223, __pyx_L1_error))
12603  __Pyx_XDECREF(__pyx_r);
12604  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
12605  __Pyx_GOTREF(__pyx_t_1);
12606  __pyx_r = __pyx_t_1;
12607  __pyx_t_1 = 0;
12608  goto __pyx_L0;
12609 
12610  /* "View.MemoryView":222
12611  *
12612  * @property
12613  * def memview(self): # <<<<<<<<<<<<<<
12614  * return self.get_memview()
12615  *
12616  */
12617 
12618  /* function exit code */
12619  __pyx_L1_error:;
12620  __Pyx_XDECREF(__pyx_t_1);
12621  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12622  __pyx_r = NULL;
12623  __pyx_L0:;
12624  __Pyx_XGIVEREF(__pyx_r);
12625  __Pyx_TraceReturn(__pyx_r, 0);
12626  __Pyx_RefNannyFinishContext();
12627  return __pyx_r;
12628 }
12629 
12630 /* "View.MemoryView":226
12631  *
12632  * @cname('get_memview')
12633  * cdef get_memview(self): # <<<<<<<<<<<<<<
12634  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12635  * return memoryview(self, flags, self.dtype_is_object)
12636  */
12637 
12638 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
12639  int __pyx_v_flags;
12640  PyObject *__pyx_r = NULL;
12641  __Pyx_TraceDeclarations
12642  __Pyx_RefNannyDeclarations
12643  PyObject *__pyx_t_1 = NULL;
12644  PyObject *__pyx_t_2 = NULL;
12645  PyObject *__pyx_t_3 = NULL;
12646  int __pyx_lineno = 0;
12647  const char *__pyx_filename = NULL;
12648  int __pyx_clineno = 0;
12649  __Pyx_RefNannySetupContext("get_memview", 0);
12650  __Pyx_TraceCall("get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
12651 
12652  /* "View.MemoryView":227
12653  * @cname('get_memview')
12654  * cdef get_memview(self):
12655  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
12656  * return memoryview(self, flags, self.dtype_is_object)
12657  *
12658  */
12659  __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
12660  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
12661 
12662  /* "View.MemoryView":228
12663  * cdef get_memview(self):
12664  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12665  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
12666  *
12667  * def __len__(self):
12668  */
12669  __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
12670  __Pyx_XDECREF(__pyx_r);
12671  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
12672  __Pyx_GOTREF(__pyx_t_1);
12673  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
12674  __Pyx_GOTREF(__pyx_t_2);
12675  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
12676  __Pyx_GOTREF(__pyx_t_3);
12677  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12678  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12679  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
12680  __Pyx_GIVEREF(__pyx_t_1);
12681  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12682  __Pyx_GIVEREF(__pyx_t_2);
12683  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12684  __pyx_t_1 = 0;
12685  __pyx_t_2 = 0;
12686  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
12687  __Pyx_GOTREF(__pyx_t_2);
12688  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12689  __pyx_r = __pyx_t_2;
12690  __pyx_t_2 = 0;
12691  goto __pyx_L0;
12692 
12693  /* "View.MemoryView":226
12694  *
12695  * @cname('get_memview')
12696  * cdef get_memview(self): # <<<<<<<<<<<<<<
12697  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12698  * return memoryview(self, flags, self.dtype_is_object)
12699  */
12700 
12701  /* function exit code */
12702  __pyx_L1_error:;
12703  __Pyx_XDECREF(__pyx_t_1);
12704  __Pyx_XDECREF(__pyx_t_2);
12705  __Pyx_XDECREF(__pyx_t_3);
12706  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
12707  __pyx_r = 0;
12708  __pyx_L0:;
12709  __Pyx_XGIVEREF(__pyx_r);
12710  __Pyx_TraceReturn(__pyx_r, 0);
12711  __Pyx_RefNannyFinishContext();
12712  return __pyx_r;
12713 }
12714 
12715 /* "View.MemoryView":230
12716  * return memoryview(self, flags, self.dtype_is_object)
12717  *
12718  * def __len__(self): # <<<<<<<<<<<<<<
12719  * return self._shape[0]
12720  *
12721  */
12722 
12723 /* Python wrapper */
12724 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
12725 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
12726  Py_ssize_t __pyx_r;
12727  __Pyx_RefNannyDeclarations
12728  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12729  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
12730 
12731  /* function exit code */
12732  __Pyx_RefNannyFinishContext();
12733  return __pyx_r;
12734 }
12735 
12736 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
12737  Py_ssize_t __pyx_r;
12738  __Pyx_TraceDeclarations
12739  __Pyx_RefNannyDeclarations
12740  int __pyx_lineno = 0;
12741  const char *__pyx_filename = NULL;
12742  int __pyx_clineno = 0;
12743  __Pyx_RefNannySetupContext("__len__", 0);
12744  __Pyx_TraceCall("__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
12745 
12746  /* "View.MemoryView":231
12747  *
12748  * def __len__(self):
12749  * return self._shape[0] # <<<<<<<<<<<<<<
12750  *
12751  * def __getattr__(self, attr):
12752  */
12753  __Pyx_TraceLine(231,0,__PYX_ERR(1, 231, __pyx_L1_error))
12754  __pyx_r = (__pyx_v_self->_shape[0]);
12755  goto __pyx_L0;
12756 
12757  /* "View.MemoryView":230
12758  * return memoryview(self, flags, self.dtype_is_object)
12759  *
12760  * def __len__(self): # <<<<<<<<<<<<<<
12761  * return self._shape[0]
12762  *
12763  */
12764 
12765  /* function exit code */
12766  __pyx_L1_error:;
12767  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12768  __pyx_r = -1;
12769  __pyx_L0:;
12770  __Pyx_TraceReturn(Py_None, 0);
12771  __Pyx_RefNannyFinishContext();
12772  return __pyx_r;
12773 }
12774 
12775 /* "View.MemoryView":233
12776  * return self._shape[0]
12777  *
12778  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
12779  * return getattr(self.memview, attr)
12780  *
12781  */
12782 
12783 /* Python wrapper */
12784 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
12785 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
12786  PyObject *__pyx_r = 0;
12787  __Pyx_RefNannyDeclarations
12788  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
12789  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
12790 
12791  /* function exit code */
12792  __Pyx_RefNannyFinishContext();
12793  return __pyx_r;
12794 }
12795 
12796 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
12797  PyObject *__pyx_r = NULL;
12798  __Pyx_TraceDeclarations
12799  __Pyx_RefNannyDeclarations
12800  PyObject *__pyx_t_1 = NULL;
12801  PyObject *__pyx_t_2 = NULL;
12802  int __pyx_lineno = 0;
12803  const char *__pyx_filename = NULL;
12804  int __pyx_clineno = 0;
12805  __Pyx_RefNannySetupContext("__getattr__", 0);
12806  __Pyx_TraceCall("__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
12807 
12808  /* "View.MemoryView":234
12809  *
12810  * def __getattr__(self, attr):
12811  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
12812  *
12813  * def __getitem__(self, item):
12814  */
12815  __Pyx_TraceLine(234,0,__PYX_ERR(1, 234, __pyx_L1_error))
12816  __Pyx_XDECREF(__pyx_r);
12817  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
12818  __Pyx_GOTREF(__pyx_t_1);
12819  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
12820  __Pyx_GOTREF(__pyx_t_2);
12821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12822  __pyx_r = __pyx_t_2;
12823  __pyx_t_2 = 0;
12824  goto __pyx_L0;
12825 
12826  /* "View.MemoryView":233
12827  * return self._shape[0]
12828  *
12829  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
12830  * return getattr(self.memview, attr)
12831  *
12832  */
12833 
12834  /* function exit code */
12835  __pyx_L1_error:;
12836  __Pyx_XDECREF(__pyx_t_1);
12837  __Pyx_XDECREF(__pyx_t_2);
12838  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12839  __pyx_r = NULL;
12840  __pyx_L0:;
12841  __Pyx_XGIVEREF(__pyx_r);
12842  __Pyx_TraceReturn(__pyx_r, 0);
12843  __Pyx_RefNannyFinishContext();
12844  return __pyx_r;
12845 }
12846 
12847 /* "View.MemoryView":236
12848  * return getattr(self.memview, attr)
12849  *
12850  * def __getitem__(self, item): # <<<<<<<<<<<<<<
12851  * return self.memview[item]
12852  *
12853  */
12854 
12855 /* Python wrapper */
12856 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
12857 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
12858  PyObject *__pyx_r = 0;
12859  __Pyx_RefNannyDeclarations
12860  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
12861  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
12862 
12863  /* function exit code */
12864  __Pyx_RefNannyFinishContext();
12865  return __pyx_r;
12866 }
12867 
12868 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
12869  PyObject *__pyx_r = NULL;
12870  __Pyx_TraceDeclarations
12871  __Pyx_RefNannyDeclarations
12872  PyObject *__pyx_t_1 = NULL;
12873  PyObject *__pyx_t_2 = NULL;
12874  int __pyx_lineno = 0;
12875  const char *__pyx_filename = NULL;
12876  int __pyx_clineno = 0;
12877  __Pyx_RefNannySetupContext("__getitem__", 0);
12878  __Pyx_TraceCall("__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
12879 
12880  /* "View.MemoryView":237
12881  *
12882  * def __getitem__(self, item):
12883  * return self.memview[item] # <<<<<<<<<<<<<<
12884  *
12885  * def __setitem__(self, item, value):
12886  */
12887  __Pyx_TraceLine(237,0,__PYX_ERR(1, 237, __pyx_L1_error))
12888  __Pyx_XDECREF(__pyx_r);
12889  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
12890  __Pyx_GOTREF(__pyx_t_1);
12891  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
12892  __Pyx_GOTREF(__pyx_t_2);
12893  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12894  __pyx_r = __pyx_t_2;
12895  __pyx_t_2 = 0;
12896  goto __pyx_L0;
12897 
12898  /* "View.MemoryView":236
12899  * return getattr(self.memview, attr)
12900  *
12901  * def __getitem__(self, item): # <<<<<<<<<<<<<<
12902  * return self.memview[item]
12903  *
12904  */
12905 
12906  /* function exit code */
12907  __pyx_L1_error:;
12908  __Pyx_XDECREF(__pyx_t_1);
12909  __Pyx_XDECREF(__pyx_t_2);
12910  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12911  __pyx_r = NULL;
12912  __pyx_L0:;
12913  __Pyx_XGIVEREF(__pyx_r);
12914  __Pyx_TraceReturn(__pyx_r, 0);
12915  __Pyx_RefNannyFinishContext();
12916  return __pyx_r;
12917 }
12918 
12919 /* "View.MemoryView":239
12920  * return self.memview[item]
12921  *
12922  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
12923  * self.memview[item] = value
12924  *
12925  */
12926 
12927 /* Python wrapper */
12928 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
12929 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
12930  int __pyx_r;
12931  __Pyx_RefNannyDeclarations
12932  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
12933  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
12934 
12935  /* function exit code */
12936  __Pyx_RefNannyFinishContext();
12937  return __pyx_r;
12938 }
12939 
12940 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
12941  int __pyx_r;
12942  __Pyx_TraceDeclarations
12943  __Pyx_RefNannyDeclarations
12944  PyObject *__pyx_t_1 = NULL;
12945  int __pyx_lineno = 0;
12946  const char *__pyx_filename = NULL;
12947  int __pyx_clineno = 0;
12948  __Pyx_RefNannySetupContext("__setitem__", 0);
12949  __Pyx_TraceCall("__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
12950 
12951  /* "View.MemoryView":240
12952  *
12953  * def __setitem__(self, item, value):
12954  * self.memview[item] = value # <<<<<<<<<<<<<<
12955  *
12956  *
12957  */
12958  __Pyx_TraceLine(240,0,__PYX_ERR(1, 240, __pyx_L1_error))
12959  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
12960  __Pyx_GOTREF(__pyx_t_1);
12961  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
12962  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12963 
12964  /* "View.MemoryView":239
12965  * return self.memview[item]
12966  *
12967  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
12968  * self.memview[item] = value
12969  *
12970  */
12971 
12972  /* function exit code */
12973  __pyx_r = 0;
12974  goto __pyx_L0;
12975  __pyx_L1_error:;
12976  __Pyx_XDECREF(__pyx_t_1);
12977  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12978  __pyx_r = -1;
12979  __pyx_L0:;
12980  __Pyx_TraceReturn(Py_None, 0);
12981  __Pyx_RefNannyFinishContext();
12982  return __pyx_r;
12983 }
12984 
12985 /* "(tree fragment)":1
12986  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12987  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12988  * def __setstate_cython__(self, __pyx_state):
12989  */
12990 
12991 /* Python wrapper */
12992 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12993 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
12994 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12995  PyObject *__pyx_r = 0;
12996  __Pyx_RefNannyDeclarations
12997  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12998  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
12999 
13000  /* function exit code */
13001  __Pyx_RefNannyFinishContext();
13002  return __pyx_r;
13003 }
13004 
13005 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
13006  PyObject *__pyx_r = NULL;
13007  __Pyx_TraceDeclarations
13008  __Pyx_RefNannyDeclarations
13009  PyObject *__pyx_t_1 = NULL;
13010  int __pyx_lineno = 0;
13011  const char *__pyx_filename = NULL;
13012  int __pyx_clineno = 0;
13013  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13014  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13015 
13016  /* "(tree fragment)":2
13017  * def __reduce_cython__(self):
13018  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13019  * def __setstate_cython__(self, __pyx_state):
13020  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13021  */
13022  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13023  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13024  __Pyx_GOTREF(__pyx_t_1);
13025  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13026  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13027  __PYX_ERR(1, 2, __pyx_L1_error)
13028 
13029  /* "(tree fragment)":1
13030  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13031  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13032  * def __setstate_cython__(self, __pyx_state):
13033  */
13034 
13035  /* function exit code */
13036  __pyx_L1_error:;
13037  __Pyx_XDECREF(__pyx_t_1);
13038  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13039  __pyx_r = NULL;
13040  __Pyx_XGIVEREF(__pyx_r);
13041  __Pyx_TraceReturn(__pyx_r, 0);
13042  __Pyx_RefNannyFinishContext();
13043  return __pyx_r;
13044 }
13045 
13046 /* "(tree fragment)":3
13047  * def __reduce_cython__(self):
13048  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13049  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13050  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13051  */
13052 
13053 /* Python wrapper */
13054 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13055 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
13056 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13057  PyObject *__pyx_r = 0;
13058  __Pyx_RefNannyDeclarations
13059  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13060  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13061 
13062  /* function exit code */
13063  __Pyx_RefNannyFinishContext();
13064  return __pyx_r;
13065 }
13066 
13067 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13068  PyObject *__pyx_r = NULL;
13069  __Pyx_TraceDeclarations
13070  __Pyx_RefNannyDeclarations
13071  PyObject *__pyx_t_1 = NULL;
13072  int __pyx_lineno = 0;
13073  const char *__pyx_filename = NULL;
13074  int __pyx_clineno = 0;
13075  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13076  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13077 
13078  /* "(tree fragment)":4
13079  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13080  * def __setstate_cython__(self, __pyx_state):
13081  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13082  */
13083  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13084  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13085  __Pyx_GOTREF(__pyx_t_1);
13086  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13087  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13088  __PYX_ERR(1, 4, __pyx_L1_error)
13089 
13090  /* "(tree fragment)":3
13091  * def __reduce_cython__(self):
13092  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13093  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13094  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13095  */
13096 
13097  /* function exit code */
13098  __pyx_L1_error:;
13099  __Pyx_XDECREF(__pyx_t_1);
13100  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13101  __pyx_r = NULL;
13102  __Pyx_XGIVEREF(__pyx_r);
13103  __Pyx_TraceReturn(__pyx_r, 0);
13104  __Pyx_RefNannyFinishContext();
13105  return __pyx_r;
13106 }
13107 
13108 /* "View.MemoryView":244
13109  *
13110  * @cname("__pyx_array_new")
13111  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
13112  * char *mode, char *buf):
13113  * cdef array result
13114  */
13115 
13116 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
13117  struct __pyx_array_obj *__pyx_v_result = 0;
13118  struct __pyx_array_obj *__pyx_r = NULL;
13119  __Pyx_TraceDeclarations
13120  __Pyx_RefNannyDeclarations
13121  int __pyx_t_1;
13122  PyObject *__pyx_t_2 = NULL;
13123  PyObject *__pyx_t_3 = NULL;
13124  PyObject *__pyx_t_4 = NULL;
13125  PyObject *__pyx_t_5 = NULL;
13126  int __pyx_lineno = 0;
13127  const char *__pyx_filename = NULL;
13128  int __pyx_clineno = 0;
13129  __Pyx_RefNannySetupContext("array_cwrapper", 0);
13130  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
13131 
13132  /* "View.MemoryView":248
13133  * cdef array result
13134  *
13135  * if buf == NULL: # <<<<<<<<<<<<<<
13136  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13137  * else:
13138  */
13139  __Pyx_TraceLine(248,0,__PYX_ERR(1, 248, __pyx_L1_error))
13140  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
13141  if (__pyx_t_1) {
13142 
13143  /* "View.MemoryView":249
13144  *
13145  * if buf == NULL:
13146  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
13147  * else:
13148  * result = array(shape, itemsize, format, mode.decode('ASCII'),
13149  */
13150  __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
13151  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
13152  __Pyx_GOTREF(__pyx_t_2);
13153  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
13154  __Pyx_GOTREF(__pyx_t_3);
13155  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
13156  __Pyx_GOTREF(__pyx_t_4);
13157  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
13158  __Pyx_GOTREF(__pyx_t_5);
13159  __Pyx_INCREF(__pyx_v_shape);
13160  __Pyx_GIVEREF(__pyx_v_shape);
13161  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
13162  __Pyx_GIVEREF(__pyx_t_2);
13163  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
13164  __Pyx_GIVEREF(__pyx_t_3);
13165  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
13166  __Pyx_GIVEREF(__pyx_t_4);
13167  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
13168  __pyx_t_2 = 0;
13169  __pyx_t_3 = 0;
13170  __pyx_t_4 = 0;
13171  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
13172  __Pyx_GOTREF(__pyx_t_4);
13173  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13174  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
13175  __pyx_t_4 = 0;
13176 
13177  /* "View.MemoryView":248
13178  * cdef array result
13179  *
13180  * if buf == NULL: # <<<<<<<<<<<<<<
13181  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13182  * else:
13183  */
13184  goto __pyx_L3;
13185  }
13186 
13187  /* "View.MemoryView":251
13188  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13189  * else:
13190  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
13191  * allocate_buffer=False)
13192  * result.data = buf
13193  */
13194  __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
13195  /*else*/ {
13196  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
13197  __Pyx_GOTREF(__pyx_t_4);
13198  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
13199  __Pyx_GOTREF(__pyx_t_5);
13200  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
13201  __Pyx_GOTREF(__pyx_t_3);
13202  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
13203  __Pyx_GOTREF(__pyx_t_2);
13204  __Pyx_INCREF(__pyx_v_shape);
13205  __Pyx_GIVEREF(__pyx_v_shape);
13206  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
13207  __Pyx_GIVEREF(__pyx_t_4);
13208  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
13209  __Pyx_GIVEREF(__pyx_t_5);
13210  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
13211  __Pyx_GIVEREF(__pyx_t_3);
13212  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
13213  __pyx_t_4 = 0;
13214  __pyx_t_5 = 0;
13215  __pyx_t_3 = 0;
13216 
13217  /* "View.MemoryView":252
13218  * else:
13219  * result = array(shape, itemsize, format, mode.decode('ASCII'),
13220  * allocate_buffer=False) # <<<<<<<<<<<<<<
13221  * result.data = buf
13222  *
13223  */
13224  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
13225  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
13226  __Pyx_GOTREF(__pyx_t_3);
13227  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
13228 
13229  /* "View.MemoryView":251
13230  * result = array(shape, itemsize, format, mode.decode('ASCII'))
13231  * else:
13232  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
13233  * allocate_buffer=False)
13234  * result.data = buf
13235  */
13236  __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
13237  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
13238  __Pyx_GOTREF(__pyx_t_5);
13239  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13240  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13241  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
13242  __pyx_t_5 = 0;
13243 
13244  /* "View.MemoryView":253
13245  * result = array(shape, itemsize, format, mode.decode('ASCII'),
13246  * allocate_buffer=False)
13247  * result.data = buf # <<<<<<<<<<<<<<
13248  *
13249  * return result
13250  */
13251  __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
13252  __pyx_v_result->data = __pyx_v_buf;
13253  }
13254  __pyx_L3:;
13255 
13256  /* "View.MemoryView":255
13257  * result.data = buf
13258  *
13259  * return result # <<<<<<<<<<<<<<
13260  *
13261  *
13262  */
13263  __Pyx_TraceLine(255,0,__PYX_ERR(1, 255, __pyx_L1_error))
13264  __Pyx_XDECREF(((PyObject *)__pyx_r));
13265  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13266  __pyx_r = __pyx_v_result;
13267  goto __pyx_L0;
13268 
13269  /* "View.MemoryView":244
13270  *
13271  * @cname("__pyx_array_new")
13272  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
13273  * char *mode, char *buf):
13274  * cdef array result
13275  */
13276 
13277  /* function exit code */
13278  __pyx_L1_error:;
13279  __Pyx_XDECREF(__pyx_t_2);
13280  __Pyx_XDECREF(__pyx_t_3);
13281  __Pyx_XDECREF(__pyx_t_4);
13282  __Pyx_XDECREF(__pyx_t_5);
13283  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13284  __pyx_r = 0;
13285  __pyx_L0:;
13286  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13287  __Pyx_XGIVEREF((PyObject *)__pyx_r);
13288  __Pyx_TraceReturn(__pyx_r, 0);
13289  __Pyx_RefNannyFinishContext();
13290  return __pyx_r;
13291 }
13292 
13293 /* "View.MemoryView":281
13294  * cdef class Enum(object):
13295  * cdef object name
13296  * def __init__(self, name): # <<<<<<<<<<<<<<
13297  * self.name = name
13298  * def __repr__(self):
13299  */
13300 
13301 /* Python wrapper */
13302 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13303 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13304  PyObject *__pyx_v_name = 0;
13305  int __pyx_lineno = 0;
13306  const char *__pyx_filename = NULL;
13307  int __pyx_clineno = 0;
13308  int __pyx_r;
13309  __Pyx_RefNannyDeclarations
13310  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
13311  {
13312  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
13313  PyObject* values[1] = {0};
13314  if (unlikely(__pyx_kwds)) {
13315  Py_ssize_t kw_args;
13316  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13317  switch (pos_args) {
13318  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13319  CYTHON_FALLTHROUGH;
13320  case 0: break;
13321  default: goto __pyx_L5_argtuple_error;
13322  }
13323  kw_args = PyDict_Size(__pyx_kwds);
13324  switch (pos_args) {
13325  case 0:
13326  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
13327  else goto __pyx_L5_argtuple_error;
13328  }
13329  if (unlikely(kw_args > 0)) {
13330  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
13331  }
13332  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
13333  goto __pyx_L5_argtuple_error;
13334  } else {
13335  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13336  }
13337  __pyx_v_name = values[0];
13338  }
13339  goto __pyx_L4_argument_unpacking_done;
13340  __pyx_L5_argtuple_error:;
13341  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
13342  __pyx_L3_error:;
13343  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13344  __Pyx_RefNannyFinishContext();
13345  return -1;
13346  __pyx_L4_argument_unpacking_done:;
13347  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
13348 
13349  /* function exit code */
13350  __Pyx_RefNannyFinishContext();
13351  return __pyx_r;
13352 }
13353 
13354 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
13355  int __pyx_r;
13356  __Pyx_TraceDeclarations
13357  __Pyx_RefNannyDeclarations
13358  int __pyx_lineno = 0;
13359  const char *__pyx_filename = NULL;
13360  int __pyx_clineno = 0;
13361  __Pyx_RefNannySetupContext("__init__", 0);
13362  __Pyx_TraceCall("__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
13363 
13364  /* "View.MemoryView":282
13365  * cdef object name
13366  * def __init__(self, name):
13367  * self.name = name # <<<<<<<<<<<<<<
13368  * def __repr__(self):
13369  * return self.name
13370  */
13371  __Pyx_TraceLine(282,0,__PYX_ERR(1, 282, __pyx_L1_error))
13372  __Pyx_INCREF(__pyx_v_name);
13373  __Pyx_GIVEREF(__pyx_v_name);
13374  __Pyx_GOTREF(__pyx_v_self->name);
13375  __Pyx_DECREF(__pyx_v_self->name);
13376  __pyx_v_self->name = __pyx_v_name;
13377 
13378  /* "View.MemoryView":281
13379  * cdef class Enum(object):
13380  * cdef object name
13381  * def __init__(self, name): # <<<<<<<<<<<<<<
13382  * self.name = name
13383  * def __repr__(self):
13384  */
13385 
13386  /* function exit code */
13387  __pyx_r = 0;
13388  goto __pyx_L0;
13389  __pyx_L1_error:;
13390  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13391  __pyx_r = -1;
13392  __pyx_L0:;
13393  __Pyx_TraceReturn(Py_None, 0);
13394  __Pyx_RefNannyFinishContext();
13395  return __pyx_r;
13396 }
13397 
13398 /* "View.MemoryView":283
13399  * def __init__(self, name):
13400  * self.name = name
13401  * def __repr__(self): # <<<<<<<<<<<<<<
13402  * return self.name
13403  *
13404  */
13405 
13406 /* Python wrapper */
13407 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
13408 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
13409  PyObject *__pyx_r = 0;
13410  __Pyx_RefNannyDeclarations
13411  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13412  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13413 
13414  /* function exit code */
13415  __Pyx_RefNannyFinishContext();
13416  return __pyx_r;
13417 }
13418 
13419 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13420  PyObject *__pyx_r = NULL;
13421  __Pyx_TraceDeclarations
13422  __Pyx_RefNannyDeclarations
13423  int __pyx_lineno = 0;
13424  const char *__pyx_filename = NULL;
13425  int __pyx_clineno = 0;
13426  __Pyx_RefNannySetupContext("__repr__", 0);
13427  __Pyx_TraceCall("__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
13428 
13429  /* "View.MemoryView":284
13430  * self.name = name
13431  * def __repr__(self):
13432  * return self.name # <<<<<<<<<<<<<<
13433  *
13434  * cdef generic = Enum("<strided and direct or indirect>")
13435  */
13436  __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error))
13437  __Pyx_XDECREF(__pyx_r);
13438  __Pyx_INCREF(__pyx_v_self->name);
13439  __pyx_r = __pyx_v_self->name;
13440  goto __pyx_L0;
13441 
13442  /* "View.MemoryView":283
13443  * def __init__(self, name):
13444  * self.name = name
13445  * def __repr__(self): # <<<<<<<<<<<<<<
13446  * return self.name
13447  *
13448  */
13449 
13450  /* function exit code */
13451  __pyx_L1_error:;
13452  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13453  __pyx_r = NULL;
13454  __pyx_L0:;
13455  __Pyx_XGIVEREF(__pyx_r);
13456  __Pyx_TraceReturn(__pyx_r, 0);
13457  __Pyx_RefNannyFinishContext();
13458  return __pyx_r;
13459 }
13460 
13461 /* "(tree fragment)":1
13462  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13463  * cdef tuple state
13464  * cdef object _dict
13465  */
13466 
13467 /* Python wrapper */
13468 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13469 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
13470 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13471  PyObject *__pyx_r = 0;
13472  __Pyx_RefNannyDeclarations
13473  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13474  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13475 
13476  /* function exit code */
13477  __Pyx_RefNannyFinishContext();
13478  return __pyx_r;
13479 }
13480 
13481 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13482  PyObject *__pyx_v_state = 0;
13483  PyObject *__pyx_v__dict = 0;
13484  int __pyx_v_use_setstate;
13485  PyObject *__pyx_r = NULL;
13486  __Pyx_TraceDeclarations
13487  __Pyx_RefNannyDeclarations
13488  PyObject *__pyx_t_1 = NULL;
13489  int __pyx_t_2;
13490  int __pyx_t_3;
13491  PyObject *__pyx_t_4 = NULL;
13492  PyObject *__pyx_t_5 = NULL;
13493  int __pyx_lineno = 0;
13494  const char *__pyx_filename = NULL;
13495  int __pyx_clineno = 0;
13496  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13497  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13498 
13499  /* "(tree fragment)":5
13500  * cdef object _dict
13501  * cdef bint use_setstate
13502  * state = (self.name,) # <<<<<<<<<<<<<<
13503  * _dict = getattr(self, '__dict__', None)
13504  * if _dict is not None:
13505  */
13506  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
13507  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
13508  __Pyx_GOTREF(__pyx_t_1);
13509  __Pyx_INCREF(__pyx_v_self->name);
13510  __Pyx_GIVEREF(__pyx_v_self->name);
13511  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
13512  __pyx_v_state = ((PyObject*)__pyx_t_1);
13513  __pyx_t_1 = 0;
13514 
13515  /* "(tree fragment)":6
13516  * cdef bint use_setstate
13517  * state = (self.name,)
13518  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
13519  * if _dict is not None:
13520  * state += (_dict,)
13521  */
13522  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
13523  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
13524  __Pyx_GOTREF(__pyx_t_1);
13525  __pyx_v__dict = __pyx_t_1;
13526  __pyx_t_1 = 0;
13527 
13528  /* "(tree fragment)":7
13529  * state = (self.name,)
13530  * _dict = getattr(self, '__dict__', None)
13531  * if _dict is not None: # <<<<<<<<<<<<<<
13532  * state += (_dict,)
13533  * use_setstate = True
13534  */
13535  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
13536  __pyx_t_2 = (__pyx_v__dict != Py_None);
13537  __pyx_t_3 = (__pyx_t_2 != 0);
13538  if (__pyx_t_3) {
13539 
13540  /* "(tree fragment)":8
13541  * _dict = getattr(self, '__dict__', None)
13542  * if _dict is not None:
13543  * state += (_dict,) # <<<<<<<<<<<<<<
13544  * use_setstate = True
13545  * else:
13546  */
13547  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
13548  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
13549  __Pyx_GOTREF(__pyx_t_1);
13550  __Pyx_INCREF(__pyx_v__dict);
13551  __Pyx_GIVEREF(__pyx_v__dict);
13552  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
13553  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
13554  __Pyx_GOTREF(__pyx_t_4);
13555  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13556  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
13557  __pyx_t_4 = 0;
13558 
13559  /* "(tree fragment)":9
13560  * if _dict is not None:
13561  * state += (_dict,)
13562  * use_setstate = True # <<<<<<<<<<<<<<
13563  * else:
13564  * use_setstate = self.name is not None
13565  */
13566  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
13567  __pyx_v_use_setstate = 1;
13568 
13569  /* "(tree fragment)":7
13570  * state = (self.name,)
13571  * _dict = getattr(self, '__dict__', None)
13572  * if _dict is not None: # <<<<<<<<<<<<<<
13573  * state += (_dict,)
13574  * use_setstate = True
13575  */
13576  goto __pyx_L3;
13577  }
13578 
13579  /* "(tree fragment)":11
13580  * use_setstate = True
13581  * else:
13582  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
13583  * if use_setstate:
13584  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13585  */
13586  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
13587  /*else*/ {
13588  __pyx_t_3 = (__pyx_v_self->name != Py_None);
13589  __pyx_v_use_setstate = __pyx_t_3;
13590  }
13591  __pyx_L3:;
13592 
13593  /* "(tree fragment)":12
13594  * else:
13595  * use_setstate = self.name is not None
13596  * if use_setstate: # <<<<<<<<<<<<<<
13597  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13598  * else:
13599  */
13600  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
13601  __pyx_t_3 = (__pyx_v_use_setstate != 0);
13602  if (__pyx_t_3) {
13603 
13604  /* "(tree fragment)":13
13605  * use_setstate = self.name is not None
13606  * if use_setstate:
13607  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
13608  * else:
13609  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13610  */
13611  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
13612  __Pyx_XDECREF(__pyx_r);
13613  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
13614  __Pyx_GOTREF(__pyx_t_4);
13615  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
13616  __Pyx_GOTREF(__pyx_t_1);
13617  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13618  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13619  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13620  __Pyx_INCREF(__pyx_int_184977713);
13621  __Pyx_GIVEREF(__pyx_int_184977713);
13622  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13623  __Pyx_INCREF(Py_None);
13624  __Pyx_GIVEREF(Py_None);
13625  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
13626  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
13627  __Pyx_GOTREF(__pyx_t_5);
13628  __Pyx_GIVEREF(__pyx_t_4);
13629  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13630  __Pyx_GIVEREF(__pyx_t_1);
13631  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
13632  __Pyx_INCREF(__pyx_v_state);
13633  __Pyx_GIVEREF(__pyx_v_state);
13634  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
13635  __pyx_t_4 = 0;
13636  __pyx_t_1 = 0;
13637  __pyx_r = __pyx_t_5;
13638  __pyx_t_5 = 0;
13639  goto __pyx_L0;
13640 
13641  /* "(tree fragment)":12
13642  * else:
13643  * use_setstate = self.name is not None
13644  * if use_setstate: # <<<<<<<<<<<<<<
13645  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13646  * else:
13647  */
13648  }
13649 
13650  /* "(tree fragment)":15
13651  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13652  * else:
13653  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
13654  * def __setstate_cython__(self, __pyx_state):
13655  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
13656  */
13657  __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
13658  /*else*/ {
13659  __Pyx_XDECREF(__pyx_r);
13660  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
13661  __Pyx_GOTREF(__pyx_t_5);
13662  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
13663  __Pyx_GOTREF(__pyx_t_1);
13664  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13665  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13666  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13667  __Pyx_INCREF(__pyx_int_184977713);
13668  __Pyx_GIVEREF(__pyx_int_184977713);
13669  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13670  __Pyx_INCREF(__pyx_v_state);
13671  __Pyx_GIVEREF(__pyx_v_state);
13672  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
13673  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
13674  __Pyx_GOTREF(__pyx_t_4);
13675  __Pyx_GIVEREF(__pyx_t_5);
13676  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
13677  __Pyx_GIVEREF(__pyx_t_1);
13678  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
13679  __pyx_t_5 = 0;
13680  __pyx_t_1 = 0;
13681  __pyx_r = __pyx_t_4;
13682  __pyx_t_4 = 0;
13683  goto __pyx_L0;
13684  }
13685 
13686  /* "(tree fragment)":1
13687  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13688  * cdef tuple state
13689  * cdef object _dict
13690  */
13691 
13692  /* function exit code */
13693  __pyx_L1_error:;
13694  __Pyx_XDECREF(__pyx_t_1);
13695  __Pyx_XDECREF(__pyx_t_4);
13696  __Pyx_XDECREF(__pyx_t_5);
13697  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13698  __pyx_r = NULL;
13699  __pyx_L0:;
13700  __Pyx_XDECREF(__pyx_v_state);
13701  __Pyx_XDECREF(__pyx_v__dict);
13702  __Pyx_XGIVEREF(__pyx_r);
13703  __Pyx_TraceReturn(__pyx_r, 0);
13704  __Pyx_RefNannyFinishContext();
13705  return __pyx_r;
13706 }
13707 
13708 /* "(tree fragment)":16
13709  * else:
13710  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13711  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13712  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
13713  */
13714 
13715 /* Python wrapper */
13716 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13717 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
13718 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13719  PyObject *__pyx_r = 0;
13720  __Pyx_RefNannyDeclarations
13721  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13722  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13723 
13724  /* function exit code */
13725  __Pyx_RefNannyFinishContext();
13726  return __pyx_r;
13727 }
13728 
13729 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13730  PyObject *__pyx_r = NULL;
13731  __Pyx_TraceDeclarations
13732  __Pyx_RefNannyDeclarations
13733  PyObject *__pyx_t_1 = NULL;
13734  int __pyx_lineno = 0;
13735  const char *__pyx_filename = NULL;
13736  int __pyx_clineno = 0;
13737  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13738  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
13739 
13740  /* "(tree fragment)":17
13741  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13742  * def __setstate_cython__(self, __pyx_state):
13743  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
13744  */
13745  __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
13746  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
13747  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
13748  __Pyx_GOTREF(__pyx_t_1);
13749  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13750 
13751  /* "(tree fragment)":16
13752  * else:
13753  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13754  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13755  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
13756  */
13757 
13758  /* function exit code */
13759  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13760  goto __pyx_L0;
13761  __pyx_L1_error:;
13762  __Pyx_XDECREF(__pyx_t_1);
13763  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13764  __pyx_r = NULL;
13765  __pyx_L0:;
13766  __Pyx_XGIVEREF(__pyx_r);
13767  __Pyx_TraceReturn(__pyx_r, 0);
13768  __Pyx_RefNannyFinishContext();
13769  return __pyx_r;
13770 }
13771 
13772 /* "View.MemoryView":298
13773  *
13774  * @cname('__pyx_align_pointer')
13775  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
13776  * "Align pointer memory on a given boundary"
13777  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
13778  */
13779 
13780 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
13781  Py_intptr_t __pyx_v_aligned_p;
13782  size_t __pyx_v_offset;
13783  void *__pyx_r;
13784  __Pyx_TraceDeclarations
13785  int __pyx_t_1;
13786  int __pyx_lineno = 0;
13787  const char *__pyx_filename = NULL;
13788  int __pyx_clineno = 0;
13789  __Pyx_TraceCall("align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
13790 
13791  /* "View.MemoryView":300
13792  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
13793  * "Align pointer memory on a given boundary"
13794  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
13795  * cdef size_t offset
13796  *
13797  */
13798  __Pyx_TraceLine(300,1,__PYX_ERR(1, 300, __pyx_L1_error))
13799  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
13800 
13801  /* "View.MemoryView":304
13802  *
13803  * with cython.cdivision(True):
13804  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
13805  *
13806  * if offset > 0:
13807  */
13808  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
13809 
13810  /* "View.MemoryView":306
13811  * offset = aligned_p % alignment
13812  *
13813  * if offset > 0: # <<<<<<<<<<<<<<
13814  * aligned_p += alignment - offset
13815  *
13816  */
13817  __Pyx_TraceLine(306,1,__PYX_ERR(1, 306, __pyx_L1_error))
13818  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
13819  if (__pyx_t_1) {
13820 
13821  /* "View.MemoryView":307
13822  *
13823  * if offset > 0:
13824  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
13825  *
13826  * return <void *> aligned_p
13827  */
13828  __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
13829  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
13830 
13831  /* "View.MemoryView":306
13832  * offset = aligned_p % alignment
13833  *
13834  * if offset > 0: # <<<<<<<<<<<<<<
13835  * aligned_p += alignment - offset
13836  *
13837  */
13838  }
13839 
13840  /* "View.MemoryView":309
13841  * aligned_p += alignment - offset
13842  *
13843  * return <void *> aligned_p # <<<<<<<<<<<<<<
13844  *
13845  *
13846  */
13847  __Pyx_TraceLine(309,1,__PYX_ERR(1, 309, __pyx_L1_error))
13848  __pyx_r = ((void *)__pyx_v_aligned_p);
13849  goto __pyx_L0;
13850 
13851  /* "View.MemoryView":298
13852  *
13853  * @cname('__pyx_align_pointer')
13854  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
13855  * "Align pointer memory on a given boundary"
13856  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
13857  */
13858 
13859  /* function exit code */
13860  __pyx_L1_error:;
13861  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
13862  __pyx_r = 0;
13863  __pyx_L0:;
13864  __Pyx_TraceReturn(Py_None, 1);
13865  return __pyx_r;
13866 }
13867 
13868 /* "View.MemoryView":345
13869  * cdef __Pyx_TypeInfo *typeinfo
13870  *
13871  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
13872  * self.obj = obj
13873  * self.flags = flags
13874  */
13875 
13876 /* Python wrapper */
13877 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13878 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13879  PyObject *__pyx_v_obj = 0;
13880  int __pyx_v_flags;
13881  int __pyx_v_dtype_is_object;
13882  int __pyx_lineno = 0;
13883  const char *__pyx_filename = NULL;
13884  int __pyx_clineno = 0;
13885  int __pyx_r;
13886  __Pyx_RefNannyDeclarations
13887  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
13888  {
13889  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
13890  PyObject* values[3] = {0,0,0};
13891  if (unlikely(__pyx_kwds)) {
13892  Py_ssize_t kw_args;
13893  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13894  switch (pos_args) {
13895  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13896  CYTHON_FALLTHROUGH;
13897  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13898  CYTHON_FALLTHROUGH;
13899  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13900  CYTHON_FALLTHROUGH;
13901  case 0: break;
13902  default: goto __pyx_L5_argtuple_error;
13903  }
13904  kw_args = PyDict_Size(__pyx_kwds);
13905  switch (pos_args) {
13906  case 0:
13907  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13908  else goto __pyx_L5_argtuple_error;
13909  CYTHON_FALLTHROUGH;
13910  case 1:
13911  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
13912  else {
13913  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
13914  }
13915  CYTHON_FALLTHROUGH;
13916  case 2:
13917  if (kw_args > 0) {
13918  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
13919  if (value) { values[2] = value; kw_args--; }
13920  }
13921  }
13922  if (unlikely(kw_args > 0)) {
13923  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
13924  }
13925  } else {
13926  switch (PyTuple_GET_SIZE(__pyx_args)) {
13927  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13928  CYTHON_FALLTHROUGH;
13929  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13930  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13931  break;
13932  default: goto __pyx_L5_argtuple_error;
13933  }
13934  }
13935  __pyx_v_obj = values[0];
13936  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
13937  if (values[2]) {
13938  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
13939  } else {
13940  __pyx_v_dtype_is_object = ((int)0);
13941  }
13942  }
13943  goto __pyx_L4_argument_unpacking_done;
13944  __pyx_L5_argtuple_error:;
13945  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
13946  __pyx_L3_error:;
13947  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13948  __Pyx_RefNannyFinishContext();
13949  return -1;
13950  __pyx_L4_argument_unpacking_done:;
13951  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
13952 
13953  /* function exit code */
13954  __Pyx_RefNannyFinishContext();
13955  return __pyx_r;
13956 }
13957 
13958 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
13959  int __pyx_r;
13960  __Pyx_TraceDeclarations
13961  __Pyx_RefNannyDeclarations
13962  int __pyx_t_1;
13963  int __pyx_t_2;
13964  int __pyx_t_3;
13965  int __pyx_t_4;
13966  int __pyx_lineno = 0;
13967  const char *__pyx_filename = NULL;
13968  int __pyx_clineno = 0;
13969  __Pyx_RefNannySetupContext("__cinit__", 0);
13970  __Pyx_TraceCall("__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
13971 
13972  /* "View.MemoryView":346
13973  *
13974  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
13975  * self.obj = obj # <<<<<<<<<<<<<<
13976  * self.flags = flags
13977  * if type(self) is memoryview or obj is not None:
13978  */
13979  __Pyx_TraceLine(346,0,__PYX_ERR(1, 346, __pyx_L1_error))
13980  __Pyx_INCREF(__pyx_v_obj);
13981  __Pyx_GIVEREF(__pyx_v_obj);
13982  __Pyx_GOTREF(__pyx_v_self->obj);
13983  __Pyx_DECREF(__pyx_v_self->obj);
13984  __pyx_v_self->obj = __pyx_v_obj;
13985 
13986  /* "View.MemoryView":347
13987  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
13988  * self.obj = obj
13989  * self.flags = flags # <<<<<<<<<<<<<<
13990  * if type(self) is memoryview or obj is not None:
13991  * __Pyx_GetBuffer(obj, &self.view, flags)
13992  */
13993  __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
13994  __pyx_v_self->flags = __pyx_v_flags;
13995 
13996  /* "View.MemoryView":348
13997  * self.obj = obj
13998  * self.flags = flags
13999  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
14000  * __Pyx_GetBuffer(obj, &self.view, flags)
14001  * if <PyObject *> self.view.obj == NULL:
14002  */
14003  __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
14004  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
14005  __pyx_t_3 = (__pyx_t_2 != 0);
14006  if (!__pyx_t_3) {
14007  } else {
14008  __pyx_t_1 = __pyx_t_3;
14009  goto __pyx_L4_bool_binop_done;
14010  }
14011  __pyx_t_3 = (__pyx_v_obj != Py_None);
14012  __pyx_t_2 = (__pyx_t_3 != 0);
14013  __pyx_t_1 = __pyx_t_2;
14014  __pyx_L4_bool_binop_done:;
14015  if (__pyx_t_1) {
14016 
14017  /* "View.MemoryView":349
14018  * self.flags = flags
14019  * if type(self) is memoryview or obj is not None:
14020  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
14021  * if <PyObject *> self.view.obj == NULL:
14022  * (<__pyx_buffer *> &self.view).obj = Py_None
14023  */
14024  __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
14025  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
14026 
14027  /* "View.MemoryView":350
14028  * if type(self) is memoryview or obj is not None:
14029  * __Pyx_GetBuffer(obj, &self.view, flags)
14030  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
14031  * (<__pyx_buffer *> &self.view).obj = Py_None
14032  * Py_INCREF(Py_None)
14033  */
14034  __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
14035  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
14036  if (__pyx_t_1) {
14037 
14038  /* "View.MemoryView":351
14039  * __Pyx_GetBuffer(obj, &self.view, flags)
14040  * if <PyObject *> self.view.obj == NULL:
14041  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
14042  * Py_INCREF(Py_None)
14043  *
14044  */
14045  __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
14046  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
14047 
14048  /* "View.MemoryView":352
14049  * if <PyObject *> self.view.obj == NULL:
14050  * (<__pyx_buffer *> &self.view).obj = Py_None
14051  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
14052  *
14053  * global __pyx_memoryview_thread_locks_used
14054  */
14055  __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
14056  Py_INCREF(Py_None);
14057 
14058  /* "View.MemoryView":350
14059  * if type(self) is memoryview or obj is not None:
14060  * __Pyx_GetBuffer(obj, &self.view, flags)
14061  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
14062  * (<__pyx_buffer *> &self.view).obj = Py_None
14063  * Py_INCREF(Py_None)
14064  */
14065  }
14066 
14067  /* "View.MemoryView":348
14068  * self.obj = obj
14069  * self.flags = flags
14070  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
14071  * __Pyx_GetBuffer(obj, &self.view, flags)
14072  * if <PyObject *> self.view.obj == NULL:
14073  */
14074  }
14075 
14076  /* "View.MemoryView":355
14077  *
14078  * global __pyx_memoryview_thread_locks_used
14079  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
14080  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14081  * __pyx_memoryview_thread_locks_used += 1
14082  */
14083  __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
14084  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
14085  if (__pyx_t_1) {
14086 
14087  /* "View.MemoryView":356
14088  * global __pyx_memoryview_thread_locks_used
14089  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
14090  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
14091  * __pyx_memoryview_thread_locks_used += 1
14092  * if self.lock is NULL:
14093  */
14094  __Pyx_TraceLine(356,0,__PYX_ERR(1, 356, __pyx_L1_error))
14095  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14096 
14097  /* "View.MemoryView":357
14098  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
14099  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14100  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
14101  * if self.lock is NULL:
14102  * self.lock = PyThread_allocate_lock()
14103  */
14104  __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
14105  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
14106 
14107  /* "View.MemoryView":355
14108  *
14109  * global __pyx_memoryview_thread_locks_used
14110  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
14111  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14112  * __pyx_memoryview_thread_locks_used += 1
14113  */
14114  }
14115 
14116  /* "View.MemoryView":358
14117  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14118  * __pyx_memoryview_thread_locks_used += 1
14119  * if self.lock is NULL: # <<<<<<<<<<<<<<
14120  * self.lock = PyThread_allocate_lock()
14121  * if self.lock is NULL:
14122  */
14123  __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
14124  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14125  if (__pyx_t_1) {
14126 
14127  /* "View.MemoryView":359
14128  * __pyx_memoryview_thread_locks_used += 1
14129  * if self.lock is NULL:
14130  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
14131  * if self.lock is NULL:
14132  * raise MemoryError
14133  */
14134  __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
14135  __pyx_v_self->lock = PyThread_allocate_lock();
14136 
14137  /* "View.MemoryView":360
14138  * if self.lock is NULL:
14139  * self.lock = PyThread_allocate_lock()
14140  * if self.lock is NULL: # <<<<<<<<<<<<<<
14141  * raise MemoryError
14142  *
14143  */
14144  __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
14145  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
14146  if (unlikely(__pyx_t_1)) {
14147 
14148  /* "View.MemoryView":361
14149  * self.lock = PyThread_allocate_lock()
14150  * if self.lock is NULL:
14151  * raise MemoryError # <<<<<<<<<<<<<<
14152  *
14153  * if flags & PyBUF_FORMAT:
14154  */
14155  __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
14156  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
14157 
14158  /* "View.MemoryView":360
14159  * if self.lock is NULL:
14160  * self.lock = PyThread_allocate_lock()
14161  * if self.lock is NULL: # <<<<<<<<<<<<<<
14162  * raise MemoryError
14163  *
14164  */
14165  }
14166 
14167  /* "View.MemoryView":358
14168  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14169  * __pyx_memoryview_thread_locks_used += 1
14170  * if self.lock is NULL: # <<<<<<<<<<<<<<
14171  * self.lock = PyThread_allocate_lock()
14172  * if self.lock is NULL:
14173  */
14174  }
14175 
14176  /* "View.MemoryView":363
14177  * raise MemoryError
14178  *
14179  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14180  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14181  * else:
14182  */
14183  __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
14184  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14185  if (__pyx_t_1) {
14186 
14187  /* "View.MemoryView":364
14188  *
14189  * if flags & PyBUF_FORMAT:
14190  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
14191  * else:
14192  * self.dtype_is_object = dtype_is_object
14193  */
14194  __Pyx_TraceLine(364,0,__PYX_ERR(1, 364, __pyx_L1_error))
14195  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
14196  if (__pyx_t_2) {
14197  } else {
14198  __pyx_t_1 = __pyx_t_2;
14199  goto __pyx_L11_bool_binop_done;
14200  }
14201  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
14202  __pyx_t_1 = __pyx_t_2;
14203  __pyx_L11_bool_binop_done:;
14204  __pyx_v_self->dtype_is_object = __pyx_t_1;
14205 
14206  /* "View.MemoryView":363
14207  * raise MemoryError
14208  *
14209  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
14210  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14211  * else:
14212  */
14213  goto __pyx_L10;
14214  }
14215 
14216  /* "View.MemoryView":366
14217  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14218  * else:
14219  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
14220  *
14221  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
14222  */
14223  __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
14224  /*else*/ {
14225  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
14226  }
14227  __pyx_L10:;
14228 
14229  /* "View.MemoryView":368
14230  * self.dtype_is_object = dtype_is_object
14231  *
14232  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
14233  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
14234  * self.typeinfo = NULL
14235  */
14236  __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
14237  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
14238 
14239  /* "View.MemoryView":370
14240  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
14241  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
14242  * self.typeinfo = NULL # <<<<<<<<<<<<<<
14243  *
14244  * def __dealloc__(memoryview self):
14245  */
14246  __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
14247  __pyx_v_self->typeinfo = NULL;
14248 
14249  /* "View.MemoryView":345
14250  * cdef __Pyx_TypeInfo *typeinfo
14251  *
14252  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
14253  * self.obj = obj
14254  * self.flags = flags
14255  */
14256 
14257  /* function exit code */
14258  __pyx_r = 0;
14259  goto __pyx_L0;
14260  __pyx_L1_error:;
14261  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14262  __pyx_r = -1;
14263  __pyx_L0:;
14264  __Pyx_TraceReturn(Py_None, 0);
14265  __Pyx_RefNannyFinishContext();
14266  return __pyx_r;
14267 }
14268 
14269 /* "View.MemoryView":372
14270  * self.typeinfo = NULL
14271  *
14272  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
14273  * if self.obj is not None:
14274  * __Pyx_ReleaseBuffer(&self.view)
14275  */
14276 
14277 /* Python wrapper */
14278 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
14279 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
14280  __Pyx_RefNannyDeclarations
14281  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14282  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14283 
14284  /* function exit code */
14285  __Pyx_RefNannyFinishContext();
14286 }
14287 
14288 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
14289  int __pyx_v_i;
14290  __Pyx_TraceDeclarations
14291  __Pyx_RefNannyDeclarations
14292  int __pyx_t_1;
14293  int __pyx_t_2;
14294  int __pyx_t_3;
14295  int __pyx_t_4;
14296  int __pyx_t_5;
14297  PyThread_type_lock __pyx_t_6;
14298  PyThread_type_lock __pyx_t_7;
14299  int __pyx_lineno = 0;
14300  const char *__pyx_filename = NULL;
14301  int __pyx_clineno = 0;
14302  __Pyx_RefNannySetupContext("__dealloc__", 0);
14303  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
14304 
14305  /* "View.MemoryView":373
14306  *
14307  * def __dealloc__(memoryview self):
14308  * if self.obj is not None: # <<<<<<<<<<<<<<
14309  * __Pyx_ReleaseBuffer(&self.view)
14310  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14311  */
14312  __Pyx_TraceLine(373,0,__PYX_ERR(1, 373, __pyx_L1_error))
14313  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
14314  __pyx_t_2 = (__pyx_t_1 != 0);
14315  if (__pyx_t_2) {
14316 
14317  /* "View.MemoryView":374
14318  * def __dealloc__(memoryview self):
14319  * if self.obj is not None:
14320  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
14321  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14322  *
14323  */
14324  __Pyx_TraceLine(374,0,__PYX_ERR(1, 374, __pyx_L1_error))
14325  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
14326 
14327  /* "View.MemoryView":373
14328  *
14329  * def __dealloc__(memoryview self):
14330  * if self.obj is not None: # <<<<<<<<<<<<<<
14331  * __Pyx_ReleaseBuffer(&self.view)
14332  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14333  */
14334  goto __pyx_L3;
14335  }
14336 
14337  /* "View.MemoryView":375
14338  * if self.obj is not None:
14339  * __Pyx_ReleaseBuffer(&self.view)
14340  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
14341  *
14342  * (<__pyx_buffer *> &self.view).obj = NULL
14343  */
14344  __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
14345  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
14346  if (__pyx_t_2) {
14347 
14348  /* "View.MemoryView":377
14349  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
14350  *
14351  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
14352  * Py_DECREF(Py_None)
14353  *
14354  */
14355  __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
14356  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
14357 
14358  /* "View.MemoryView":378
14359  *
14360  * (<__pyx_buffer *> &self.view).obj = NULL
14361  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
14362  *
14363  * cdef int i
14364  */
14365  __Pyx_TraceLine(378,0,__PYX_ERR(1, 378, __pyx_L1_error))
14366  Py_DECREF(Py_None);
14367 
14368  /* "View.MemoryView":375
14369  * if self.obj is not None:
14370  * __Pyx_ReleaseBuffer(&self.view)
14371  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
14372  *
14373  * (<__pyx_buffer *> &self.view).obj = NULL
14374  */
14375  }
14376  __pyx_L3:;
14377 
14378  /* "View.MemoryView":382
14379  * cdef int i
14380  * global __pyx_memoryview_thread_locks_used
14381  * if self.lock != NULL: # <<<<<<<<<<<<<<
14382  * for i in range(__pyx_memoryview_thread_locks_used):
14383  * if __pyx_memoryview_thread_locks[i] is self.lock:
14384  */
14385  __Pyx_TraceLine(382,0,__PYX_ERR(1, 382, __pyx_L1_error))
14386  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
14387  if (__pyx_t_2) {
14388 
14389  /* "View.MemoryView":383
14390  * global __pyx_memoryview_thread_locks_used
14391  * if self.lock != NULL:
14392  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
14393  * if __pyx_memoryview_thread_locks[i] is self.lock:
14394  * __pyx_memoryview_thread_locks_used -= 1
14395  */
14396  __Pyx_TraceLine(383,0,__PYX_ERR(1, 383, __pyx_L1_error))
14397  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
14398  __pyx_t_4 = __pyx_t_3;
14399  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
14400  __pyx_v_i = __pyx_t_5;
14401 
14402  /* "View.MemoryView":384
14403  * if self.lock != NULL:
14404  * for i in range(__pyx_memoryview_thread_locks_used):
14405  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
14406  * __pyx_memoryview_thread_locks_used -= 1
14407  * if i != __pyx_memoryview_thread_locks_used:
14408  */
14409  __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
14410  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
14411  if (__pyx_t_2) {
14412 
14413  /* "View.MemoryView":385
14414  * for i in range(__pyx_memoryview_thread_locks_used):
14415  * if __pyx_memoryview_thread_locks[i] is self.lock:
14416  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
14417  * if i != __pyx_memoryview_thread_locks_used:
14418  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14419  */
14420  __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
14421  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
14422 
14423  /* "View.MemoryView":386
14424  * if __pyx_memoryview_thread_locks[i] is self.lock:
14425  * __pyx_memoryview_thread_locks_used -= 1
14426  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
14427  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14428  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14429  */
14430  __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
14431  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
14432  if (__pyx_t_2) {
14433 
14434  /* "View.MemoryView":388
14435  * if i != __pyx_memoryview_thread_locks_used:
14436  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14437  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
14438  * break
14439  * else:
14440  */
14441  __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
14442  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14443  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
14444 
14445  /* "View.MemoryView":387
14446  * __pyx_memoryview_thread_locks_used -= 1
14447  * if i != __pyx_memoryview_thread_locks_used:
14448  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
14449  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14450  * break
14451  */
14452  __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
14453  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
14454  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
14455 
14456  /* "View.MemoryView":386
14457  * if __pyx_memoryview_thread_locks[i] is self.lock:
14458  * __pyx_memoryview_thread_locks_used -= 1
14459  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
14460  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14461  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14462  */
14463  }
14464 
14465  /* "View.MemoryView":389
14466  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14467  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14468  * break # <<<<<<<<<<<<<<
14469  * else:
14470  * PyThread_free_lock(self.lock)
14471  */
14472  __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
14473  goto __pyx_L6_break;
14474 
14475  /* "View.MemoryView":384
14476  * if self.lock != NULL:
14477  * for i in range(__pyx_memoryview_thread_locks_used):
14478  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
14479  * __pyx_memoryview_thread_locks_used -= 1
14480  * if i != __pyx_memoryview_thread_locks_used:
14481  */
14482  }
14483  }
14484  /*else*/ {
14485 
14486  /* "View.MemoryView":391
14487  * break
14488  * else:
14489  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
14490  *
14491  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
14492  */
14493  __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
14494  PyThread_free_lock(__pyx_v_self->lock);
14495  }
14496  __pyx_L6_break:;
14497 
14498  /* "View.MemoryView":382
14499  * cdef int i
14500  * global __pyx_memoryview_thread_locks_used
14501  * if self.lock != NULL: # <<<<<<<<<<<<<<
14502  * for i in range(__pyx_memoryview_thread_locks_used):
14503  * if __pyx_memoryview_thread_locks[i] is self.lock:
14504  */
14505  }
14506 
14507  /* "View.MemoryView":372
14508  * self.typeinfo = NULL
14509  *
14510  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
14511  * if self.obj is not None:
14512  * __Pyx_ReleaseBuffer(&self.view)
14513  */
14514 
14515  /* function exit code */
14516  goto __pyx_L0;
14517  __pyx_L1_error:;
14518  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14519  __pyx_L0:;
14520  __Pyx_TraceReturn(Py_None, 0);
14521  __Pyx_RefNannyFinishContext();
14522 }
14523 
14524 /* "View.MemoryView":393
14525  * PyThread_free_lock(self.lock)
14526  *
14527  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
14528  * cdef Py_ssize_t dim
14529  * cdef char *itemp = <char *> self.view.buf
14530  */
14531 
14532 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14533  Py_ssize_t __pyx_v_dim;
14534  char *__pyx_v_itemp;
14535  PyObject *__pyx_v_idx = NULL;
14536  char *__pyx_r;
14537  __Pyx_TraceDeclarations
14538  __Pyx_RefNannyDeclarations
14539  Py_ssize_t __pyx_t_1;
14540  PyObject *__pyx_t_2 = NULL;
14541  Py_ssize_t __pyx_t_3;
14542  PyObject *(*__pyx_t_4)(PyObject *);
14543  PyObject *__pyx_t_5 = NULL;
14544  Py_ssize_t __pyx_t_6;
14545  char *__pyx_t_7;
14546  int __pyx_lineno = 0;
14547  const char *__pyx_filename = NULL;
14548  int __pyx_clineno = 0;
14549  __Pyx_RefNannySetupContext("get_item_pointer", 0);
14550  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
14551 
14552  /* "View.MemoryView":395
14553  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
14554  * cdef Py_ssize_t dim
14555  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
14556  *
14557  * for dim, idx in enumerate(index):
14558  */
14559  __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
14560  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
14561 
14562  /* "View.MemoryView":397
14563  * cdef char *itemp = <char *> self.view.buf
14564  *
14565  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
14566  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
14567  *
14568  */
14569  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
14570  __pyx_t_1 = 0;
14571  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
14572  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
14573  __pyx_t_4 = NULL;
14574  } else {
14575  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
14576  __Pyx_GOTREF(__pyx_t_2);
14577  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
14578  }
14579  for (;;) {
14580  if (likely(!__pyx_t_4)) {
14581  if (likely(PyList_CheckExact(__pyx_t_2))) {
14582  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
14583  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14584  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
14585  #else
14586  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
14587  __Pyx_GOTREF(__pyx_t_5);
14588  #endif
14589  } else {
14590  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
14591  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14592  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
14593  #else
14594  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
14595  __Pyx_GOTREF(__pyx_t_5);
14596  #endif
14597  }
14598  } else {
14599  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
14600  if (unlikely(!__pyx_t_5)) {
14601  PyObject* exc_type = PyErr_Occurred();
14602  if (exc_type) {
14603  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14604  else __PYX_ERR(1, 397, __pyx_L1_error)
14605  }
14606  break;
14607  }
14608  __Pyx_GOTREF(__pyx_t_5);
14609  }
14610  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
14611  __pyx_t_5 = 0;
14612  __pyx_v_dim = __pyx_t_1;
14613  __pyx_t_1 = (__pyx_t_1 + 1);
14614 
14615  /* "View.MemoryView":398
14616  *
14617  * for dim, idx in enumerate(index):
14618  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
14619  *
14620  * return itemp
14621  */
14622  __Pyx_TraceLine(398,0,__PYX_ERR(1, 398, __pyx_L1_error))
14623  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
14624  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
14625  __pyx_v_itemp = __pyx_t_7;
14626 
14627  /* "View.MemoryView":397
14628  * cdef char *itemp = <char *> self.view.buf
14629  *
14630  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
14631  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
14632  *
14633  */
14634  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
14635  }
14636  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14637 
14638  /* "View.MemoryView":400
14639  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
14640  *
14641  * return itemp # <<<<<<<<<<<<<<
14642  *
14643  *
14644  */
14645  __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
14646  __pyx_r = __pyx_v_itemp;
14647  goto __pyx_L0;
14648 
14649  /* "View.MemoryView":393
14650  * PyThread_free_lock(self.lock)
14651  *
14652  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
14653  * cdef Py_ssize_t dim
14654  * cdef char *itemp = <char *> self.view.buf
14655  */
14656 
14657  /* function exit code */
14658  __pyx_L1_error:;
14659  __Pyx_XDECREF(__pyx_t_2);
14660  __Pyx_XDECREF(__pyx_t_5);
14661  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
14662  __pyx_r = NULL;
14663  __pyx_L0:;
14664  __Pyx_XDECREF(__pyx_v_idx);
14665  __Pyx_TraceReturn(Py_None, 0);
14666  __Pyx_RefNannyFinishContext();
14667  return __pyx_r;
14668 }
14669 
14670 /* "View.MemoryView":403
14671  *
14672  *
14673  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
14674  * if index is Ellipsis:
14675  * return self
14676  */
14677 
14678 /* Python wrapper */
14679 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
14680 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
14681  PyObject *__pyx_r = 0;
14682  __Pyx_RefNannyDeclarations
14683  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
14684  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
14685 
14686  /* function exit code */
14687  __Pyx_RefNannyFinishContext();
14688  return __pyx_r;
14689 }
14690 
14691 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14692  PyObject *__pyx_v_have_slices = NULL;
14693  PyObject *__pyx_v_indices = NULL;
14694  char *__pyx_v_itemp;
14695  PyObject *__pyx_r = NULL;
14696  __Pyx_TraceDeclarations
14697  __Pyx_RefNannyDeclarations
14698  int __pyx_t_1;
14699  int __pyx_t_2;
14700  PyObject *__pyx_t_3 = NULL;
14701  PyObject *__pyx_t_4 = NULL;
14702  PyObject *__pyx_t_5 = NULL;
14703  char *__pyx_t_6;
14704  int __pyx_lineno = 0;
14705  const char *__pyx_filename = NULL;
14706  int __pyx_clineno = 0;
14707  __Pyx_RefNannySetupContext("__getitem__", 0);
14708  __Pyx_TraceCall("__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
14709 
14710  /* "View.MemoryView":404
14711  *
14712  * def __getitem__(memoryview self, object index):
14713  * if index is Ellipsis: # <<<<<<<<<<<<<<
14714  * return self
14715  *
14716  */
14717  __Pyx_TraceLine(404,0,__PYX_ERR(1, 404, __pyx_L1_error))
14718  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
14719  __pyx_t_2 = (__pyx_t_1 != 0);
14720  if (__pyx_t_2) {
14721 
14722  /* "View.MemoryView":405
14723  * def __getitem__(memoryview self, object index):
14724  * if index is Ellipsis:
14725  * return self # <<<<<<<<<<<<<<
14726  *
14727  * have_slices, indices = _unellipsify(index, self.view.ndim)
14728  */
14729  __Pyx_TraceLine(405,0,__PYX_ERR(1, 405, __pyx_L1_error))
14730  __Pyx_XDECREF(__pyx_r);
14731  __Pyx_INCREF(((PyObject *)__pyx_v_self));
14732  __pyx_r = ((PyObject *)__pyx_v_self);
14733  goto __pyx_L0;
14734 
14735  /* "View.MemoryView":404
14736  *
14737  * def __getitem__(memoryview self, object index):
14738  * if index is Ellipsis: # <<<<<<<<<<<<<<
14739  * return self
14740  *
14741  */
14742  }
14743 
14744  /* "View.MemoryView":407
14745  * return self
14746  *
14747  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
14748  *
14749  * cdef char *itemp
14750  */
14751  __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
14752  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
14753  __Pyx_GOTREF(__pyx_t_3);
14754  if (likely(__pyx_t_3 != Py_None)) {
14755  PyObject* sequence = __pyx_t_3;
14756  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14757  if (unlikely(size != 2)) {
14758  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14759  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14760  __PYX_ERR(1, 407, __pyx_L1_error)
14761  }
14762  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14763  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
14764  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
14765  __Pyx_INCREF(__pyx_t_4);
14766  __Pyx_INCREF(__pyx_t_5);
14767  #else
14768  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
14769  __Pyx_GOTREF(__pyx_t_4);
14770  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
14771  __Pyx_GOTREF(__pyx_t_5);
14772  #endif
14773  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14774  } else {
14775  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
14776  }
14777  __pyx_v_have_slices = __pyx_t_4;
14778  __pyx_t_4 = 0;
14779  __pyx_v_indices = __pyx_t_5;
14780  __pyx_t_5 = 0;
14781 
14782  /* "View.MemoryView":410
14783  *
14784  * cdef char *itemp
14785  * if have_slices: # <<<<<<<<<<<<<<
14786  * return memview_slice(self, indices)
14787  * else:
14788  */
14789  __Pyx_TraceLine(410,0,__PYX_ERR(1, 410, __pyx_L1_error))
14790  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
14791  if (__pyx_t_2) {
14792 
14793  /* "View.MemoryView":411
14794  * cdef char *itemp
14795  * if have_slices:
14796  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
14797  * else:
14798  * itemp = self.get_item_pointer(indices)
14799  */
14800  __Pyx_TraceLine(411,0,__PYX_ERR(1, 411, __pyx_L1_error))
14801  __Pyx_XDECREF(__pyx_r);
14802  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
14803  __Pyx_GOTREF(__pyx_t_3);
14804  __pyx_r = __pyx_t_3;
14805  __pyx_t_3 = 0;
14806  goto __pyx_L0;
14807 
14808  /* "View.MemoryView":410
14809  *
14810  * cdef char *itemp
14811  * if have_slices: # <<<<<<<<<<<<<<
14812  * return memview_slice(self, indices)
14813  * else:
14814  */
14815  }
14816 
14817  /* "View.MemoryView":413
14818  * return memview_slice(self, indices)
14819  * else:
14820  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
14821  * return self.convert_item_to_object(itemp)
14822  *
14823  */
14824  __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
14825  /*else*/ {
14826  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
14827  __pyx_v_itemp = __pyx_t_6;
14828 
14829  /* "View.MemoryView":414
14830  * else:
14831  * itemp = self.get_item_pointer(indices)
14832  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
14833  *
14834  * def __setitem__(memoryview self, object index, object value):
14835  */
14836  __Pyx_TraceLine(414,0,__PYX_ERR(1, 414, __pyx_L1_error))
14837  __Pyx_XDECREF(__pyx_r);
14838  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
14839  __Pyx_GOTREF(__pyx_t_3);
14840  __pyx_r = __pyx_t_3;
14841  __pyx_t_3 = 0;
14842  goto __pyx_L0;
14843  }
14844 
14845  /* "View.MemoryView":403
14846  *
14847  *
14848  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
14849  * if index is Ellipsis:
14850  * return self
14851  */
14852 
14853  /* function exit code */
14854  __pyx_L1_error:;
14855  __Pyx_XDECREF(__pyx_t_3);
14856  __Pyx_XDECREF(__pyx_t_4);
14857  __Pyx_XDECREF(__pyx_t_5);
14858  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14859  __pyx_r = NULL;
14860  __pyx_L0:;
14861  __Pyx_XDECREF(__pyx_v_have_slices);
14862  __Pyx_XDECREF(__pyx_v_indices);
14863  __Pyx_XGIVEREF(__pyx_r);
14864  __Pyx_TraceReturn(__pyx_r, 0);
14865  __Pyx_RefNannyFinishContext();
14866  return __pyx_r;
14867 }
14868 
14869 /* "View.MemoryView":416
14870  * return self.convert_item_to_object(itemp)
14871  *
14872  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
14873  * if self.view.readonly:
14874  * raise TypeError("Cannot assign to read-only memoryview")
14875  */
14876 
14877 /* Python wrapper */
14878 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
14879 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14880  int __pyx_r;
14881  __Pyx_RefNannyDeclarations
14882  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
14883  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
14884 
14885  /* function exit code */
14886  __Pyx_RefNannyFinishContext();
14887  return __pyx_r;
14888 }
14889 
14890 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14891  PyObject *__pyx_v_have_slices = NULL;
14892  PyObject *__pyx_v_obj = NULL;
14893  int __pyx_r;
14894  __Pyx_TraceDeclarations
14895  __Pyx_RefNannyDeclarations
14896  int __pyx_t_1;
14897  PyObject *__pyx_t_2 = NULL;
14898  PyObject *__pyx_t_3 = NULL;
14899  PyObject *__pyx_t_4 = NULL;
14900  int __pyx_lineno = 0;
14901  const char *__pyx_filename = NULL;
14902  int __pyx_clineno = 0;
14903  __Pyx_RefNannySetupContext("__setitem__", 0);
14904  __Pyx_TraceCall("__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
14905  __Pyx_INCREF(__pyx_v_index);
14906 
14907  /* "View.MemoryView":417
14908  *
14909  * def __setitem__(memoryview self, object index, object value):
14910  * if self.view.readonly: # <<<<<<<<<<<<<<
14911  * raise TypeError("Cannot assign to read-only memoryview")
14912  *
14913  */
14914  __Pyx_TraceLine(417,0,__PYX_ERR(1, 417, __pyx_L1_error))
14915  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
14916  if (unlikely(__pyx_t_1)) {
14917 
14918  /* "View.MemoryView":418
14919  * def __setitem__(memoryview self, object index, object value):
14920  * if self.view.readonly:
14921  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
14922  *
14923  * have_slices, index = _unellipsify(index, self.view.ndim)
14924  */
14925  __Pyx_TraceLine(418,0,__PYX_ERR(1, 418, __pyx_L1_error))
14926  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
14927  __Pyx_GOTREF(__pyx_t_2);
14928  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14929  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14930  __PYX_ERR(1, 418, __pyx_L1_error)
14931 
14932  /* "View.MemoryView":417
14933  *
14934  * def __setitem__(memoryview self, object index, object value):
14935  * if self.view.readonly: # <<<<<<<<<<<<<<
14936  * raise TypeError("Cannot assign to read-only memoryview")
14937  *
14938  */
14939  }
14940 
14941  /* "View.MemoryView":420
14942  * raise TypeError("Cannot assign to read-only memoryview")
14943  *
14944  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
14945  *
14946  * if have_slices:
14947  */
14948  __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
14949  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
14950  __Pyx_GOTREF(__pyx_t_2);
14951  if (likely(__pyx_t_2 != Py_None)) {
14952  PyObject* sequence = __pyx_t_2;
14953  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14954  if (unlikely(size != 2)) {
14955  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14956  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14957  __PYX_ERR(1, 420, __pyx_L1_error)
14958  }
14959  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14960  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
14961  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
14962  __Pyx_INCREF(__pyx_t_3);
14963  __Pyx_INCREF(__pyx_t_4);
14964  #else
14965  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
14966  __Pyx_GOTREF(__pyx_t_3);
14967  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
14968  __Pyx_GOTREF(__pyx_t_4);
14969  #endif
14970  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14971  } else {
14972  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
14973  }
14974  __pyx_v_have_slices = __pyx_t_3;
14975  __pyx_t_3 = 0;
14976  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
14977  __pyx_t_4 = 0;
14978 
14979  /* "View.MemoryView":422
14980  * have_slices, index = _unellipsify(index, self.view.ndim)
14981  *
14982  * if have_slices: # <<<<<<<<<<<<<<
14983  * obj = self.is_slice(value)
14984  * if obj:
14985  */
14986  __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
14987  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
14988  if (__pyx_t_1) {
14989 
14990  /* "View.MemoryView":423
14991  *
14992  * if have_slices:
14993  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
14994  * if obj:
14995  * self.setitem_slice_assignment(self[index], obj)
14996  */
14997  __Pyx_TraceLine(423,0,__PYX_ERR(1, 423, __pyx_L1_error))
14998  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
14999  __Pyx_GOTREF(__pyx_t_2);
15000  __pyx_v_obj = __pyx_t_2;
15001  __pyx_t_2 = 0;
15002 
15003  /* "View.MemoryView":424
15004  * if have_slices:
15005  * obj = self.is_slice(value)
15006  * if obj: # <<<<<<<<<<<<<<
15007  * self.setitem_slice_assignment(self[index], obj)
15008  * else:
15009  */
15010  __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
15011  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
15012  if (__pyx_t_1) {
15013 
15014  /* "View.MemoryView":425
15015  * obj = self.is_slice(value)
15016  * if obj:
15017  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
15018  * else:
15019  * self.setitem_slice_assign_scalar(self[index], value)
15020  */
15021  __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
15022  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
15023  __Pyx_GOTREF(__pyx_t_2);
15024  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
15025  __Pyx_GOTREF(__pyx_t_4);
15026  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15027  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15028 
15029  /* "View.MemoryView":424
15030  * if have_slices:
15031  * obj = self.is_slice(value)
15032  * if obj: # <<<<<<<<<<<<<<
15033  * self.setitem_slice_assignment(self[index], obj)
15034  * else:
15035  */
15036  goto __pyx_L5;
15037  }
15038 
15039  /* "View.MemoryView":427
15040  * self.setitem_slice_assignment(self[index], obj)
15041  * else:
15042  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
15043  * else:
15044  * self.setitem_indexed(index, value)
15045  */
15046  __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
15047  /*else*/ {
15048  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
15049  __Pyx_GOTREF(__pyx_t_4);
15050  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
15051  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
15052  __Pyx_GOTREF(__pyx_t_2);
15053  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15054  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15055  }
15056  __pyx_L5:;
15057 
15058  /* "View.MemoryView":422
15059  * have_slices, index = _unellipsify(index, self.view.ndim)
15060  *
15061  * if have_slices: # <<<<<<<<<<<<<<
15062  * obj = self.is_slice(value)
15063  * if obj:
15064  */
15065  goto __pyx_L4;
15066  }
15067 
15068  /* "View.MemoryView":429
15069  * self.setitem_slice_assign_scalar(self[index], value)
15070  * else:
15071  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
15072  *
15073  * cdef is_slice(self, obj):
15074  */
15075  __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
15076  /*else*/ {
15077  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
15078  __Pyx_GOTREF(__pyx_t_2);
15079  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15080  }
15081  __pyx_L4:;
15082 
15083  /* "View.MemoryView":416
15084  * return self.convert_item_to_object(itemp)
15085  *
15086  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
15087  * if self.view.readonly:
15088  * raise TypeError("Cannot assign to read-only memoryview")
15089  */
15090 
15091  /* function exit code */
15092  __pyx_r = 0;
15093  goto __pyx_L0;
15094  __pyx_L1_error:;
15095  __Pyx_XDECREF(__pyx_t_2);
15096  __Pyx_XDECREF(__pyx_t_3);
15097  __Pyx_XDECREF(__pyx_t_4);
15098  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15099  __pyx_r = -1;
15100  __pyx_L0:;
15101  __Pyx_XDECREF(__pyx_v_have_slices);
15102  __Pyx_XDECREF(__pyx_v_obj);
15103  __Pyx_XDECREF(__pyx_v_index);
15104  __Pyx_TraceReturn(Py_None, 0);
15105  __Pyx_RefNannyFinishContext();
15106  return __pyx_r;
15107 }
15108 
15109 /* "View.MemoryView":431
15110  * self.setitem_indexed(index, value)
15111  *
15112  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
15113  * if not isinstance(obj, memoryview):
15114  * try:
15115  */
15116 
15117 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
15118  PyObject *__pyx_r = NULL;
15119  __Pyx_TraceDeclarations
15120  __Pyx_RefNannyDeclarations
15121  int __pyx_t_1;
15122  int __pyx_t_2;
15123  PyObject *__pyx_t_3 = NULL;
15124  PyObject *__pyx_t_4 = NULL;
15125  PyObject *__pyx_t_5 = NULL;
15126  PyObject *__pyx_t_6 = NULL;
15127  PyObject *__pyx_t_7 = NULL;
15128  PyObject *__pyx_t_8 = NULL;
15129  int __pyx_t_9;
15130  int __pyx_lineno = 0;
15131  const char *__pyx_filename = NULL;
15132  int __pyx_clineno = 0;
15133  __Pyx_RefNannySetupContext("is_slice", 0);
15134  __Pyx_TraceCall("is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
15135  __Pyx_INCREF(__pyx_v_obj);
15136 
15137  /* "View.MemoryView":432
15138  *
15139  * cdef is_slice(self, obj):
15140  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
15141  * try:
15142  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15143  */
15144  __Pyx_TraceLine(432,0,__PYX_ERR(1, 432, __pyx_L1_error))
15145  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
15146  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15147  if (__pyx_t_2) {
15148 
15149  /* "View.MemoryView":433
15150  * cdef is_slice(self, obj):
15151  * if not isinstance(obj, memoryview):
15152  * try: # <<<<<<<<<<<<<<
15153  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15154  * self.dtype_is_object)
15155  */
15156  __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
15157  {
15158  __Pyx_PyThreadState_declare
15159  __Pyx_PyThreadState_assign
15160  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15161  __Pyx_XGOTREF(__pyx_t_3);
15162  __Pyx_XGOTREF(__pyx_t_4);
15163  __Pyx_XGOTREF(__pyx_t_5);
15164  /*try:*/ {
15165 
15166  /* "View.MemoryView":434
15167  * if not isinstance(obj, memoryview):
15168  * try:
15169  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
15170  * self.dtype_is_object)
15171  * except TypeError:
15172  */
15173  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
15174  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
15175  __Pyx_GOTREF(__pyx_t_6);
15176 
15177  /* "View.MemoryView":435
15178  * try:
15179  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15180  * self.dtype_is_object) # <<<<<<<<<<<<<<
15181  * except TypeError:
15182  * return None
15183  */
15184  __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L4_error))
15185  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
15186  __Pyx_GOTREF(__pyx_t_7);
15187 
15188  /* "View.MemoryView":434
15189  * if not isinstance(obj, memoryview):
15190  * try:
15191  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
15192  * self.dtype_is_object)
15193  * except TypeError:
15194  */
15195  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
15196  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
15197  __Pyx_GOTREF(__pyx_t_8);
15198  __Pyx_INCREF(__pyx_v_obj);
15199  __Pyx_GIVEREF(__pyx_v_obj);
15200  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
15201  __Pyx_GIVEREF(__pyx_t_6);
15202  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
15203  __Pyx_GIVEREF(__pyx_t_7);
15204  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
15205  __pyx_t_6 = 0;
15206  __pyx_t_7 = 0;
15207  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
15208  __Pyx_GOTREF(__pyx_t_7);
15209  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15210  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
15211  __pyx_t_7 = 0;
15212 
15213  /* "View.MemoryView":433
15214  * cdef is_slice(self, obj):
15215  * if not isinstance(obj, memoryview):
15216  * try: # <<<<<<<<<<<<<<
15217  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15218  * self.dtype_is_object)
15219  */
15220  }
15221  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15222  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15223  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15224  goto __pyx_L9_try_end;
15225  __pyx_L4_error:;
15226  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15227  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15228  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15229 
15230  /* "View.MemoryView":436
15231  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15232  * self.dtype_is_object)
15233  * except TypeError: # <<<<<<<<<<<<<<
15234  * return None
15235  *
15236  */
15237  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L6_except_error))
15238  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
15239  if (__pyx_t_9) {
15240  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15241  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
15242  __Pyx_GOTREF(__pyx_t_7);
15243  __Pyx_GOTREF(__pyx_t_8);
15244  __Pyx_GOTREF(__pyx_t_6);
15245 
15246  /* "View.MemoryView":437
15247  * self.dtype_is_object)
15248  * except TypeError:
15249  * return None # <<<<<<<<<<<<<<
15250  *
15251  * return obj
15252  */
15253  __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L6_except_error))
15254  __Pyx_XDECREF(__pyx_r);
15255  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15256  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15257  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15258  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15259  goto __pyx_L7_except_return;
15260  }
15261  goto __pyx_L6_except_error;
15262  __pyx_L6_except_error:;
15263 
15264  /* "View.MemoryView":433
15265  * cdef is_slice(self, obj):
15266  * if not isinstance(obj, memoryview):
15267  * try: # <<<<<<<<<<<<<<
15268  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15269  * self.dtype_is_object)
15270  */
15271  __Pyx_XGIVEREF(__pyx_t_3);
15272  __Pyx_XGIVEREF(__pyx_t_4);
15273  __Pyx_XGIVEREF(__pyx_t_5);
15274  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15275  goto __pyx_L1_error;
15276  __pyx_L7_except_return:;
15277  __Pyx_XGIVEREF(__pyx_t_3);
15278  __Pyx_XGIVEREF(__pyx_t_4);
15279  __Pyx_XGIVEREF(__pyx_t_5);
15280  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15281  goto __pyx_L0;
15282  __pyx_L9_try_end:;
15283  }
15284 
15285  /* "View.MemoryView":432
15286  *
15287  * cdef is_slice(self, obj):
15288  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
15289  * try:
15290  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15291  */
15292  }
15293 
15294  /* "View.MemoryView":439
15295  * return None
15296  *
15297  * return obj # <<<<<<<<<<<<<<
15298  *
15299  * cdef setitem_slice_assignment(self, dst, src):
15300  */
15301  __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L1_error))
15302  __Pyx_XDECREF(__pyx_r);
15303  __Pyx_INCREF(__pyx_v_obj);
15304  __pyx_r = __pyx_v_obj;
15305  goto __pyx_L0;
15306 
15307  /* "View.MemoryView":431
15308  * self.setitem_indexed(index, value)
15309  *
15310  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
15311  * if not isinstance(obj, memoryview):
15312  * try:
15313  */
15314 
15315  /* function exit code */
15316  __pyx_L1_error:;
15317  __Pyx_XDECREF(__pyx_t_6);
15318  __Pyx_XDECREF(__pyx_t_7);
15319  __Pyx_XDECREF(__pyx_t_8);
15320  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15321  __pyx_r = 0;
15322  __pyx_L0:;
15323  __Pyx_XDECREF(__pyx_v_obj);
15324  __Pyx_XGIVEREF(__pyx_r);
15325  __Pyx_TraceReturn(__pyx_r, 0);
15326  __Pyx_RefNannyFinishContext();
15327  return __pyx_r;
15328 }
15329 
15330 /* "View.MemoryView":441
15331  * return obj
15332  *
15333  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
15334  * cdef __Pyx_memviewslice dst_slice
15335  * cdef __Pyx_memviewslice src_slice
15336  */
15337 
15338 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
15339  __Pyx_memviewslice __pyx_v_dst_slice;
15340  __Pyx_memviewslice __pyx_v_src_slice;
15341  PyObject *__pyx_r = NULL;
15342  __Pyx_TraceDeclarations
15343  __Pyx_RefNannyDeclarations
15344  __Pyx_memviewslice *__pyx_t_1;
15345  __Pyx_memviewslice *__pyx_t_2;
15346  PyObject *__pyx_t_3 = NULL;
15347  int __pyx_t_4;
15348  int __pyx_t_5;
15349  int __pyx_t_6;
15350  int __pyx_lineno = 0;
15351  const char *__pyx_filename = NULL;
15352  int __pyx_clineno = 0;
15353  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
15354  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
15355 
15356  /* "View.MemoryView":445
15357  * cdef __Pyx_memviewslice src_slice
15358  *
15359  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
15360  * get_slice_from_memview(dst, &dst_slice)[0],
15361  * src.ndim, dst.ndim, self.dtype_is_object)
15362  */
15363  __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
15364  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
15365  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
15366 
15367  /* "View.MemoryView":446
15368  *
15369  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
15370  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
15371  * src.ndim, dst.ndim, self.dtype_is_object)
15372  *
15373  */
15374  __Pyx_TraceLine(446,0,__PYX_ERR(1, 446, __pyx_L1_error))
15375  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
15376  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
15377 
15378  /* "View.MemoryView":447
15379  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
15380  * get_slice_from_memview(dst, &dst_slice)[0],
15381  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
15382  *
15383  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
15384  */
15385  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
15386  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
15387  __Pyx_GOTREF(__pyx_t_3);
15388  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
15389  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15390  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
15391  __Pyx_GOTREF(__pyx_t_3);
15392  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
15393  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15394 
15395  /* "View.MemoryView":445
15396  * cdef __Pyx_memviewslice src_slice
15397  *
15398  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
15399  * get_slice_from_memview(dst, &dst_slice)[0],
15400  * src.ndim, dst.ndim, self.dtype_is_object)
15401  */
15402  __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
15403  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
15404 
15405  /* "View.MemoryView":441
15406  * return obj
15407  *
15408  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
15409  * cdef __Pyx_memviewslice dst_slice
15410  * cdef __Pyx_memviewslice src_slice
15411  */
15412 
15413  /* function exit code */
15414  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15415  goto __pyx_L0;
15416  __pyx_L1_error:;
15417  __Pyx_XDECREF(__pyx_t_3);
15418  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
15419  __pyx_r = 0;
15420  __pyx_L0:;
15421  __Pyx_XGIVEREF(__pyx_r);
15422  __Pyx_TraceReturn(__pyx_r, 0);
15423  __Pyx_RefNannyFinishContext();
15424  return __pyx_r;
15425 }
15426 
15427 /* "View.MemoryView":449
15428  * src.ndim, dst.ndim, self.dtype_is_object)
15429  *
15430  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
15431  * cdef int array[128]
15432  * cdef void *tmp = NULL
15433  */
15434 
15435 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
15436  int __pyx_v_array[0x80];
15437  void *__pyx_v_tmp;
15438  void *__pyx_v_item;
15439  __Pyx_memviewslice *__pyx_v_dst_slice;
15440  __Pyx_memviewslice __pyx_v_tmp_slice;
15441  PyObject *__pyx_r = NULL;
15442  __Pyx_TraceDeclarations
15443  __Pyx_RefNannyDeclarations
15444  __Pyx_memviewslice *__pyx_t_1;
15445  int __pyx_t_2;
15446  PyObject *__pyx_t_3 = NULL;
15447  int __pyx_t_4;
15448  int __pyx_t_5;
15449  char const *__pyx_t_6;
15450  PyObject *__pyx_t_7 = NULL;
15451  PyObject *__pyx_t_8 = NULL;
15452  PyObject *__pyx_t_9 = NULL;
15453  PyObject *__pyx_t_10 = NULL;
15454  PyObject *__pyx_t_11 = NULL;
15455  PyObject *__pyx_t_12 = NULL;
15456  int __pyx_lineno = 0;
15457  const char *__pyx_filename = NULL;
15458  int __pyx_clineno = 0;
15459  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
15460  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
15461 
15462  /* "View.MemoryView":451
15463  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
15464  * cdef int array[128]
15465  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
15466  * cdef void *item
15467  *
15468  */
15469  __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
15470  __pyx_v_tmp = NULL;
15471 
15472  /* "View.MemoryView":456
15473  * cdef __Pyx_memviewslice *dst_slice
15474  * cdef __Pyx_memviewslice tmp_slice
15475  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
15476  *
15477  * if <size_t>self.view.itemsize > sizeof(array):
15478  */
15479  __Pyx_TraceLine(456,0,__PYX_ERR(1, 456, __pyx_L1_error))
15480  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
15481  __pyx_v_dst_slice = __pyx_t_1;
15482 
15483  /* "View.MemoryView":458
15484  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
15485  *
15486  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
15487  * tmp = PyMem_Malloc(self.view.itemsize)
15488  * if tmp == NULL:
15489  */
15490  __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
15491  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
15492  if (__pyx_t_2) {
15493 
15494  /* "View.MemoryView":459
15495  *
15496  * if <size_t>self.view.itemsize > sizeof(array):
15497  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
15498  * if tmp == NULL:
15499  * raise MemoryError
15500  */
15501  __Pyx_TraceLine(459,0,__PYX_ERR(1, 459, __pyx_L1_error))
15502  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
15503 
15504  /* "View.MemoryView":460
15505  * if <size_t>self.view.itemsize > sizeof(array):
15506  * tmp = PyMem_Malloc(self.view.itemsize)
15507  * if tmp == NULL: # <<<<<<<<<<<<<<
15508  * raise MemoryError
15509  * item = tmp
15510  */
15511  __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
15512  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
15513  if (unlikely(__pyx_t_2)) {
15514 
15515  /* "View.MemoryView":461
15516  * tmp = PyMem_Malloc(self.view.itemsize)
15517  * if tmp == NULL:
15518  * raise MemoryError # <<<<<<<<<<<<<<
15519  * item = tmp
15520  * else:
15521  */
15522  __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
15523  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
15524 
15525  /* "View.MemoryView":460
15526  * if <size_t>self.view.itemsize > sizeof(array):
15527  * tmp = PyMem_Malloc(self.view.itemsize)
15528  * if tmp == NULL: # <<<<<<<<<<<<<<
15529  * raise MemoryError
15530  * item = tmp
15531  */
15532  }
15533 
15534  /* "View.MemoryView":462
15535  * if tmp == NULL:
15536  * raise MemoryError
15537  * item = tmp # <<<<<<<<<<<<<<
15538  * else:
15539  * item = <void *> array
15540  */
15541  __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
15542  __pyx_v_item = __pyx_v_tmp;
15543 
15544  /* "View.MemoryView":458
15545  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
15546  *
15547  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
15548  * tmp = PyMem_Malloc(self.view.itemsize)
15549  * if tmp == NULL:
15550  */
15551  goto __pyx_L3;
15552  }
15553 
15554  /* "View.MemoryView":464
15555  * item = tmp
15556  * else:
15557  * item = <void *> array # <<<<<<<<<<<<<<
15558  *
15559  * try:
15560  */
15561  __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
15562  /*else*/ {
15563  __pyx_v_item = ((void *)__pyx_v_array);
15564  }
15565  __pyx_L3:;
15566 
15567  /* "View.MemoryView":466
15568  * item = <void *> array
15569  *
15570  * try: # <<<<<<<<<<<<<<
15571  * if self.dtype_is_object:
15572  * (<PyObject **> item)[0] = <PyObject *> value
15573  */
15574  __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
15575  /*try:*/ {
15576 
15577  /* "View.MemoryView":467
15578  *
15579  * try:
15580  * if self.dtype_is_object: # <<<<<<<<<<<<<<
15581  * (<PyObject **> item)[0] = <PyObject *> value
15582  * else:
15583  */
15584  __Pyx_TraceLine(467,0,__PYX_ERR(1, 467, __pyx_L6_error))
15585  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
15586  if (__pyx_t_2) {
15587 
15588  /* "View.MemoryView":468
15589  * try:
15590  * if self.dtype_is_object:
15591  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
15592  * else:
15593  * self.assign_item_from_object(<char *> item, value)
15594  */
15595  __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L6_error))
15596  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
15597 
15598  /* "View.MemoryView":467
15599  *
15600  * try:
15601  * if self.dtype_is_object: # <<<<<<<<<<<<<<
15602  * (<PyObject **> item)[0] = <PyObject *> value
15603  * else:
15604  */
15605  goto __pyx_L8;
15606  }
15607 
15608  /* "View.MemoryView":470
15609  * (<PyObject **> item)[0] = <PyObject *> value
15610  * else:
15611  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
15612  *
15613  *
15614  */
15615  __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
15616  /*else*/ {
15617  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
15618  __Pyx_GOTREF(__pyx_t_3);
15619  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15620  }
15621  __pyx_L8:;
15622 
15623  /* "View.MemoryView":474
15624  *
15625  *
15626  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
15627  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15628  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15629  */
15630  __Pyx_TraceLine(474,0,__PYX_ERR(1, 474, __pyx_L6_error))
15631  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
15632  if (__pyx_t_2) {
15633 
15634  /* "View.MemoryView":475
15635  *
15636  * if self.view.suboffsets != NULL:
15637  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
15638  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15639  * item, self.dtype_is_object)
15640  */
15641  __Pyx_TraceLine(475,0,__PYX_ERR(1, 475, __pyx_L6_error))
15642  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
15643  __Pyx_GOTREF(__pyx_t_3);
15644  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15645 
15646  /* "View.MemoryView":474
15647  *
15648  *
15649  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
15650  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15651  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15652  */
15653  }
15654 
15655  /* "View.MemoryView":476
15656  * if self.view.suboffsets != NULL:
15657  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15658  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
15659  * item, self.dtype_is_object)
15660  * finally:
15661  */
15662  __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
15663  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
15664  }
15665 
15666  /* "View.MemoryView":479
15667  * item, self.dtype_is_object)
15668  * finally:
15669  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
15670  *
15671  * cdef setitem_indexed(self, index, value):
15672  */
15673  __Pyx_TraceLine(479,0,__PYX_ERR(1, 479, __pyx_L6_error))
15674  /*finally:*/ {
15675  /*normal exit:*/{
15676  PyMem_Free(__pyx_v_tmp);
15677  goto __pyx_L7;
15678  }
15679  __pyx_L6_error:;
15680  /*exception exit:*/{
15681  __Pyx_PyThreadState_declare
15682  __Pyx_PyThreadState_assign
15683  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15684  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15685  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
15686  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
15687  __Pyx_XGOTREF(__pyx_t_7);
15688  __Pyx_XGOTREF(__pyx_t_8);
15689  __Pyx_XGOTREF(__pyx_t_9);
15690  __Pyx_XGOTREF(__pyx_t_10);
15691  __Pyx_XGOTREF(__pyx_t_11);
15692  __Pyx_XGOTREF(__pyx_t_12);
15693  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
15694  {
15695  PyMem_Free(__pyx_v_tmp);
15696  }
15697  if (PY_MAJOR_VERSION >= 3) {
15698  __Pyx_XGIVEREF(__pyx_t_10);
15699  __Pyx_XGIVEREF(__pyx_t_11);
15700  __Pyx_XGIVEREF(__pyx_t_12);
15701  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
15702  }
15703  __Pyx_XGIVEREF(__pyx_t_7);
15704  __Pyx_XGIVEREF(__pyx_t_8);
15705  __Pyx_XGIVEREF(__pyx_t_9);
15706  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
15707  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15708  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
15709  goto __pyx_L1_error;
15710  }
15711  __pyx_L7:;
15712  }
15713 
15714  /* "View.MemoryView":449
15715  * src.ndim, dst.ndim, self.dtype_is_object)
15716  *
15717  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
15718  * cdef int array[128]
15719  * cdef void *tmp = NULL
15720  */
15721 
15722  /* function exit code */
15723  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15724  goto __pyx_L0;
15725  __pyx_L1_error:;
15726  __Pyx_XDECREF(__pyx_t_3);
15727  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
15728  __pyx_r = 0;
15729  __pyx_L0:;
15730  __Pyx_XGIVEREF(__pyx_r);
15731  __Pyx_TraceReturn(__pyx_r, 0);
15732  __Pyx_RefNannyFinishContext();
15733  return __pyx_r;
15734 }
15735 
15736 /* "View.MemoryView":481
15737  * PyMem_Free(tmp)
15738  *
15739  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
15740  * cdef char *itemp = self.get_item_pointer(index)
15741  * self.assign_item_from_object(itemp, value)
15742  */
15743 
15744 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15745  char *__pyx_v_itemp;
15746  PyObject *__pyx_r = NULL;
15747  __Pyx_TraceDeclarations
15748  __Pyx_RefNannyDeclarations
15749  char *__pyx_t_1;
15750  PyObject *__pyx_t_2 = NULL;
15751  int __pyx_lineno = 0;
15752  const char *__pyx_filename = NULL;
15753  int __pyx_clineno = 0;
15754  __Pyx_RefNannySetupContext("setitem_indexed", 0);
15755  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
15756 
15757  /* "View.MemoryView":482
15758  *
15759  * cdef setitem_indexed(self, index, value):
15760  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
15761  * self.assign_item_from_object(itemp, value)
15762  *
15763  */
15764  __Pyx_TraceLine(482,0,__PYX_ERR(1, 482, __pyx_L1_error))
15765  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
15766  __pyx_v_itemp = __pyx_t_1;
15767 
15768  /* "View.MemoryView":483
15769  * cdef setitem_indexed(self, index, value):
15770  * cdef char *itemp = self.get_item_pointer(index)
15771  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
15772  *
15773  * cdef convert_item_to_object(self, char *itemp):
15774  */
15775  __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
15776  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
15777  __Pyx_GOTREF(__pyx_t_2);
15778  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15779 
15780  /* "View.MemoryView":481
15781  * PyMem_Free(tmp)
15782  *
15783  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
15784  * cdef char *itemp = self.get_item_pointer(index)
15785  * self.assign_item_from_object(itemp, value)
15786  */
15787 
15788  /* function exit code */
15789  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15790  goto __pyx_L0;
15791  __pyx_L1_error:;
15792  __Pyx_XDECREF(__pyx_t_2);
15793  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
15794  __pyx_r = 0;
15795  __pyx_L0:;
15796  __Pyx_XGIVEREF(__pyx_r);
15797  __Pyx_TraceReturn(__pyx_r, 0);
15798  __Pyx_RefNannyFinishContext();
15799  return __pyx_r;
15800 }
15801 
15802 /* "View.MemoryView":485
15803  * self.assign_item_from_object(itemp, value)
15804  *
15805  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15806  * """Only used if instantiated manually by the user, or if Cython doesn't
15807  * know how to convert the type"""
15808  */
15809 
15810 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
15811  PyObject *__pyx_v_struct = NULL;
15812  PyObject *__pyx_v_bytesitem = 0;
15813  PyObject *__pyx_v_result = NULL;
15814  PyObject *__pyx_r = NULL;
15815  __Pyx_TraceDeclarations
15816  __Pyx_RefNannyDeclarations
15817  PyObject *__pyx_t_1 = NULL;
15818  PyObject *__pyx_t_2 = NULL;
15819  PyObject *__pyx_t_3 = NULL;
15820  PyObject *__pyx_t_4 = NULL;
15821  PyObject *__pyx_t_5 = NULL;
15822  PyObject *__pyx_t_6 = NULL;
15823  PyObject *__pyx_t_7 = NULL;
15824  int __pyx_t_8;
15825  PyObject *__pyx_t_9 = NULL;
15826  size_t __pyx_t_10;
15827  int __pyx_t_11;
15828  int __pyx_lineno = 0;
15829  const char *__pyx_filename = NULL;
15830  int __pyx_clineno = 0;
15831  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
15832  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
15833 
15834  /* "View.MemoryView":488
15835  * """Only used if instantiated manually by the user, or if Cython doesn't
15836  * know how to convert the type"""
15837  * import struct # <<<<<<<<<<<<<<
15838  * cdef bytes bytesitem
15839  *
15840  */
15841  __Pyx_TraceLine(488,0,__PYX_ERR(1, 488, __pyx_L1_error))
15842  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
15843  __Pyx_GOTREF(__pyx_t_1);
15844  __pyx_v_struct = __pyx_t_1;
15845  __pyx_t_1 = 0;
15846 
15847  /* "View.MemoryView":491
15848  * cdef bytes bytesitem
15849  *
15850  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
15851  * try:
15852  * result = struct.unpack(self.view.format, bytesitem)
15853  */
15854  __Pyx_TraceLine(491,0,__PYX_ERR(1, 491, __pyx_L1_error))
15855  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
15856  __Pyx_GOTREF(__pyx_t_1);
15857  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
15858  __pyx_t_1 = 0;
15859 
15860  /* "View.MemoryView":492
15861  *
15862  * bytesitem = itemp[:self.view.itemsize]
15863  * try: # <<<<<<<<<<<<<<
15864  * result = struct.unpack(self.view.format, bytesitem)
15865  * except struct.error:
15866  */
15867  __Pyx_TraceLine(492,0,__PYX_ERR(1, 492, __pyx_L1_error))
15868  {
15869  __Pyx_PyThreadState_declare
15870  __Pyx_PyThreadState_assign
15871  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
15872  __Pyx_XGOTREF(__pyx_t_2);
15873  __Pyx_XGOTREF(__pyx_t_3);
15874  __Pyx_XGOTREF(__pyx_t_4);
15875  /*try:*/ {
15876 
15877  /* "View.MemoryView":493
15878  * bytesitem = itemp[:self.view.itemsize]
15879  * try:
15880  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
15881  * except struct.error:
15882  * raise ValueError("Unable to convert item to object")
15883  */
15884  __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L3_error))
15885  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
15886  __Pyx_GOTREF(__pyx_t_5);
15887  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
15888  __Pyx_GOTREF(__pyx_t_6);
15889  __pyx_t_7 = NULL;
15890  __pyx_t_8 = 0;
15891  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
15892  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
15893  if (likely(__pyx_t_7)) {
15894  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
15895  __Pyx_INCREF(__pyx_t_7);
15896  __Pyx_INCREF(function);
15897  __Pyx_DECREF_SET(__pyx_t_5, function);
15898  __pyx_t_8 = 1;
15899  }
15900  }
15901  #if CYTHON_FAST_PYCALL
15902  if (PyFunction_Check(__pyx_t_5)) {
15903  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
15904  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15905  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15906  __Pyx_GOTREF(__pyx_t_1);
15907  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15908  } else
15909  #endif
15910  #if CYTHON_FAST_PYCCALL
15911  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
15912  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
15913  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15914  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15915  __Pyx_GOTREF(__pyx_t_1);
15916  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15917  } else
15918  #endif
15919  {
15920  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
15921  __Pyx_GOTREF(__pyx_t_9);
15922  if (__pyx_t_7) {
15923  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
15924  }
15925  __Pyx_GIVEREF(__pyx_t_6);
15926  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
15927  __Pyx_INCREF(__pyx_v_bytesitem);
15928  __Pyx_GIVEREF(__pyx_v_bytesitem);
15929  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
15930  __pyx_t_6 = 0;
15931  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15932  __Pyx_GOTREF(__pyx_t_1);
15933  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15934  }
15935  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15936  __pyx_v_result = __pyx_t_1;
15937  __pyx_t_1 = 0;
15938 
15939  /* "View.MemoryView":492
15940  *
15941  * bytesitem = itemp[:self.view.itemsize]
15942  * try: # <<<<<<<<<<<<<<
15943  * result = struct.unpack(self.view.format, bytesitem)
15944  * except struct.error:
15945  */
15946  }
15947 
15948  /* "View.MemoryView":497
15949  * raise ValueError("Unable to convert item to object")
15950  * else:
15951  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
15952  * return result[0]
15953  * return result
15954  */
15955  __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
15956  /*else:*/ {
15957  __pyx_t_10 = strlen(__pyx_v_self->view.format);
15958  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
15959  if (__pyx_t_11) {
15960 
15961  /* "View.MemoryView":498
15962  * else:
15963  * if len(self.view.format) == 1:
15964  * return result[0] # <<<<<<<<<<<<<<
15965  * return result
15966  *
15967  */
15968  __Pyx_TraceLine(498,0,__PYX_ERR(1, 498, __pyx_L5_except_error))
15969  __Pyx_XDECREF(__pyx_r);
15970  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
15971  __Pyx_GOTREF(__pyx_t_1);
15972  __pyx_r = __pyx_t_1;
15973  __pyx_t_1 = 0;
15974  goto __pyx_L6_except_return;
15975 
15976  /* "View.MemoryView":497
15977  * raise ValueError("Unable to convert item to object")
15978  * else:
15979  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
15980  * return result[0]
15981  * return result
15982  */
15983  }
15984 
15985  /* "View.MemoryView":499
15986  * if len(self.view.format) == 1:
15987  * return result[0]
15988  * return result # <<<<<<<<<<<<<<
15989  *
15990  * cdef assign_item_from_object(self, char *itemp, object value):
15991  */
15992  __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
15993  __Pyx_XDECREF(__pyx_r);
15994  __Pyx_INCREF(__pyx_v_result);
15995  __pyx_r = __pyx_v_result;
15996  goto __pyx_L6_except_return;
15997  }
15998  __pyx_L3_error:;
15999  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16000  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16001  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16002  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16003  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16004 
16005  /* "View.MemoryView":494
16006  * try:
16007  * result = struct.unpack(self.view.format, bytesitem)
16008  * except struct.error: # <<<<<<<<<<<<<<
16009  * raise ValueError("Unable to convert item to object")
16010  * else:
16011  */
16012  __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L5_except_error))
16013  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
16014  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
16015  __Pyx_GOTREF(__pyx_t_6);
16016  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
16017  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16018  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
16019  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
16020  if (__pyx_t_8) {
16021  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16022  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
16023  __Pyx_GOTREF(__pyx_t_9);
16024  __Pyx_GOTREF(__pyx_t_5);
16025  __Pyx_GOTREF(__pyx_t_1);
16026 
16027  /* "View.MemoryView":495
16028  * result = struct.unpack(self.view.format, bytesitem)
16029  * except struct.error:
16030  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
16031  * else:
16032  * if len(self.view.format) == 1:
16033  */
16034  __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L5_except_error))
16035  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
16036  __Pyx_GOTREF(__pyx_t_6);
16037  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
16038  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16039  __PYX_ERR(1, 495, __pyx_L5_except_error)
16040  }
16041  goto __pyx_L5_except_error;
16042  __pyx_L5_except_error:;
16043 
16044  /* "View.MemoryView":492
16045  *
16046  * bytesitem = itemp[:self.view.itemsize]
16047  * try: # <<<<<<<<<<<<<<
16048  * result = struct.unpack(self.view.format, bytesitem)
16049  * except struct.error:
16050  */
16051  __Pyx_XGIVEREF(__pyx_t_2);
16052  __Pyx_XGIVEREF(__pyx_t_3);
16053  __Pyx_XGIVEREF(__pyx_t_4);
16054  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16055  goto __pyx_L1_error;
16056  __pyx_L6_except_return:;
16057  __Pyx_XGIVEREF(__pyx_t_2);
16058  __Pyx_XGIVEREF(__pyx_t_3);
16059  __Pyx_XGIVEREF(__pyx_t_4);
16060  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
16061  goto __pyx_L0;
16062  }
16063 
16064  /* "View.MemoryView":485
16065  * self.assign_item_from_object(itemp, value)
16066  *
16067  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16068  * """Only used if instantiated manually by the user, or if Cython doesn't
16069  * know how to convert the type"""
16070  */
16071 
16072  /* function exit code */
16073  __pyx_L1_error:;
16074  __Pyx_XDECREF(__pyx_t_1);
16075  __Pyx_XDECREF(__pyx_t_5);
16076  __Pyx_XDECREF(__pyx_t_6);
16077  __Pyx_XDECREF(__pyx_t_7);
16078  __Pyx_XDECREF(__pyx_t_9);
16079  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16080  __pyx_r = 0;
16081  __pyx_L0:;
16082  __Pyx_XDECREF(__pyx_v_struct);
16083  __Pyx_XDECREF(__pyx_v_bytesitem);
16084  __Pyx_XDECREF(__pyx_v_result);
16085  __Pyx_XGIVEREF(__pyx_r);
16086  __Pyx_TraceReturn(__pyx_r, 0);
16087  __Pyx_RefNannyFinishContext();
16088  return __pyx_r;
16089 }
16090 
16091 /* "View.MemoryView":501
16092  * return result
16093  *
16094  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16095  * """Only used if instantiated manually by the user, or if Cython doesn't
16096  * know how to convert the type"""
16097  */
16098 
16099 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16100  PyObject *__pyx_v_struct = NULL;
16101  char __pyx_v_c;
16102  PyObject *__pyx_v_bytesvalue = 0;
16103  Py_ssize_t __pyx_v_i;
16104  PyObject *__pyx_r = NULL;
16105  __Pyx_TraceDeclarations
16106  __Pyx_RefNannyDeclarations
16107  PyObject *__pyx_t_1 = NULL;
16108  int __pyx_t_2;
16109  int __pyx_t_3;
16110  PyObject *__pyx_t_4 = NULL;
16111  PyObject *__pyx_t_5 = NULL;
16112  PyObject *__pyx_t_6 = NULL;
16113  int __pyx_t_7;
16114  PyObject *__pyx_t_8 = NULL;
16115  Py_ssize_t __pyx_t_9;
16116  PyObject *__pyx_t_10 = NULL;
16117  char *__pyx_t_11;
16118  char *__pyx_t_12;
16119  char *__pyx_t_13;
16120  char *__pyx_t_14;
16121  int __pyx_lineno = 0;
16122  const char *__pyx_filename = NULL;
16123  int __pyx_clineno = 0;
16124  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16125  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
16126 
16127  /* "View.MemoryView":504
16128  * """Only used if instantiated manually by the user, or if Cython doesn't
16129  * know how to convert the type"""
16130  * import struct # <<<<<<<<<<<<<<
16131  * cdef char c
16132  * cdef bytes bytesvalue
16133  */
16134  __Pyx_TraceLine(504,0,__PYX_ERR(1, 504, __pyx_L1_error))
16135  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
16136  __Pyx_GOTREF(__pyx_t_1);
16137  __pyx_v_struct = __pyx_t_1;
16138  __pyx_t_1 = 0;
16139 
16140  /* "View.MemoryView":509
16141  * cdef Py_ssize_t i
16142  *
16143  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
16144  * bytesvalue = struct.pack(self.view.format, *value)
16145  * else:
16146  */
16147  __Pyx_TraceLine(509,0,__PYX_ERR(1, 509, __pyx_L1_error))
16148  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
16149  __pyx_t_3 = (__pyx_t_2 != 0);
16150  if (__pyx_t_3) {
16151 
16152  /* "View.MemoryView":510
16153  *
16154  * if isinstance(value, tuple):
16155  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
16156  * else:
16157  * bytesvalue = struct.pack(self.view.format, value)
16158  */
16159  __Pyx_TraceLine(510,0,__PYX_ERR(1, 510, __pyx_L1_error))
16160  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
16161  __Pyx_GOTREF(__pyx_t_1);
16162  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
16163  __Pyx_GOTREF(__pyx_t_4);
16164  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
16165  __Pyx_GOTREF(__pyx_t_5);
16166  __Pyx_GIVEREF(__pyx_t_4);
16167  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
16168  __pyx_t_4 = 0;
16169  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
16170  __Pyx_GOTREF(__pyx_t_4);
16171  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
16172  __Pyx_GOTREF(__pyx_t_6);
16173  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16174  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16175  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
16176  __Pyx_GOTREF(__pyx_t_4);
16177  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16178  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16179  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
16180  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16181  __pyx_t_4 = 0;
16182 
16183  /* "View.MemoryView":509
16184  * cdef Py_ssize_t i
16185  *
16186  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
16187  * bytesvalue = struct.pack(self.view.format, *value)
16188  * else:
16189  */
16190  goto __pyx_L3;
16191  }
16192 
16193  /* "View.MemoryView":512
16194  * bytesvalue = struct.pack(self.view.format, *value)
16195  * else:
16196  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
16197  *
16198  * for i, c in enumerate(bytesvalue):
16199  */
16200  __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
16201  /*else*/ {
16202  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
16203  __Pyx_GOTREF(__pyx_t_6);
16204  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
16205  __Pyx_GOTREF(__pyx_t_1);
16206  __pyx_t_5 = NULL;
16207  __pyx_t_7 = 0;
16208  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
16209  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16210  if (likely(__pyx_t_5)) {
16211  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
16212  __Pyx_INCREF(__pyx_t_5);
16213  __Pyx_INCREF(function);
16214  __Pyx_DECREF_SET(__pyx_t_6, function);
16215  __pyx_t_7 = 1;
16216  }
16217  }
16218  #if CYTHON_FAST_PYCALL
16219  if (PyFunction_Check(__pyx_t_6)) {
16220  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16221  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16222  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16223  __Pyx_GOTREF(__pyx_t_4);
16224  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16225  } else
16226  #endif
16227  #if CYTHON_FAST_PYCCALL
16228  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
16229  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
16230  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16231  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16232  __Pyx_GOTREF(__pyx_t_4);
16233  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16234  } else
16235  #endif
16236  {
16237  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
16238  __Pyx_GOTREF(__pyx_t_8);
16239  if (__pyx_t_5) {
16240  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
16241  }
16242  __Pyx_GIVEREF(__pyx_t_1);
16243  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
16244  __Pyx_INCREF(__pyx_v_value);
16245  __Pyx_GIVEREF(__pyx_v_value);
16246  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
16247  __pyx_t_1 = 0;
16248  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
16249  __Pyx_GOTREF(__pyx_t_4);
16250  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16251  }
16252  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16253  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
16254  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
16255  __pyx_t_4 = 0;
16256  }
16257  __pyx_L3:;
16258 
16259  /* "View.MemoryView":514
16260  * bytesvalue = struct.pack(self.view.format, value)
16261  *
16262  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
16263  * itemp[i] = c
16264  *
16265  */
16266  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
16267  __pyx_t_9 = 0;
16268  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
16269  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
16270  __PYX_ERR(1, 514, __pyx_L1_error)
16271  }
16272  __Pyx_INCREF(__pyx_v_bytesvalue);
16273  __pyx_t_10 = __pyx_v_bytesvalue;
16274  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
16275  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
16276  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
16277  __pyx_t_11 = __pyx_t_14;
16278  __pyx_v_c = (__pyx_t_11[0]);
16279 
16280  /* "View.MemoryView":515
16281  *
16282  * for i, c in enumerate(bytesvalue):
16283  * itemp[i] = c # <<<<<<<<<<<<<<
16284  *
16285  * @cname('getbuffer')
16286  */
16287  __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
16288  __pyx_v_i = __pyx_t_9;
16289 
16290  /* "View.MemoryView":514
16291  * bytesvalue = struct.pack(self.view.format, value)
16292  *
16293  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
16294  * itemp[i] = c
16295  *
16296  */
16297  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
16298  __pyx_t_9 = (__pyx_t_9 + 1);
16299 
16300  /* "View.MemoryView":515
16301  *
16302  * for i, c in enumerate(bytesvalue):
16303  * itemp[i] = c # <<<<<<<<<<<<<<
16304  *
16305  * @cname('getbuffer')
16306  */
16307  __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
16308  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
16309  }
16310  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16311 
16312  /* "View.MemoryView":501
16313  * return result
16314  *
16315  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16316  * """Only used if instantiated manually by the user, or if Cython doesn't
16317  * know how to convert the type"""
16318  */
16319 
16320  /* function exit code */
16321  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16322  goto __pyx_L0;
16323  __pyx_L1_error:;
16324  __Pyx_XDECREF(__pyx_t_1);
16325  __Pyx_XDECREF(__pyx_t_4);
16326  __Pyx_XDECREF(__pyx_t_5);
16327  __Pyx_XDECREF(__pyx_t_6);
16328  __Pyx_XDECREF(__pyx_t_8);
16329  __Pyx_XDECREF(__pyx_t_10);
16330  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16331  __pyx_r = 0;
16332  __pyx_L0:;
16333  __Pyx_XDECREF(__pyx_v_struct);
16334  __Pyx_XDECREF(__pyx_v_bytesvalue);
16335  __Pyx_XGIVEREF(__pyx_r);
16336  __Pyx_TraceReturn(__pyx_r, 0);
16337  __Pyx_RefNannyFinishContext();
16338  return __pyx_r;
16339 }
16340 
16341 /* "View.MemoryView":518
16342  *
16343  * @cname('getbuffer')
16344  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
16345  * if flags & PyBUF_WRITABLE and self.view.readonly:
16346  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16347  */
16348 
16349 /* Python wrapper */
16350 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
16351 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
16352  int __pyx_r;
16353  __Pyx_RefNannyDeclarations
16354  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
16355  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
16356 
16357  /* function exit code */
16358  __Pyx_RefNannyFinishContext();
16359  return __pyx_r;
16360 }
16361 
16362 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
16363  int __pyx_r;
16364  __Pyx_TraceDeclarations
16365  __Pyx_RefNannyDeclarations
16366  int __pyx_t_1;
16367  int __pyx_t_2;
16368  PyObject *__pyx_t_3 = NULL;
16369  Py_ssize_t *__pyx_t_4;
16370  char *__pyx_t_5;
16371  void *__pyx_t_6;
16372  int __pyx_t_7;
16373  Py_ssize_t __pyx_t_8;
16374  int __pyx_lineno = 0;
16375  const char *__pyx_filename = NULL;
16376  int __pyx_clineno = 0;
16377  if (__pyx_v_info == NULL) {
16378  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
16379  return -1;
16380  }
16381  __Pyx_RefNannySetupContext("__getbuffer__", 0);
16382  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
16383  __Pyx_GIVEREF(__pyx_v_info->obj);
16384  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
16385 
16386  /* "View.MemoryView":519
16387  * @cname('getbuffer')
16388  * def __getbuffer__(self, Py_buffer *info, int flags):
16389  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
16390  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16391  *
16392  */
16393  __Pyx_TraceLine(519,0,__PYX_ERR(1, 519, __pyx_L1_error))
16394  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
16395  if (__pyx_t_2) {
16396  } else {
16397  __pyx_t_1 = __pyx_t_2;
16398  goto __pyx_L4_bool_binop_done;
16399  }
16400  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
16401  __pyx_t_1 = __pyx_t_2;
16402  __pyx_L4_bool_binop_done:;
16403  if (unlikely(__pyx_t_1)) {
16404 
16405  /* "View.MemoryView":520
16406  * def __getbuffer__(self, Py_buffer *info, int flags):
16407  * if flags & PyBUF_WRITABLE and self.view.readonly:
16408  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
16409  *
16410  * if flags & PyBUF_ND:
16411  */
16412  __Pyx_TraceLine(520,0,__PYX_ERR(1, 520, __pyx_L1_error))
16413  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
16414  __Pyx_GOTREF(__pyx_t_3);
16415  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16416  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16417  __PYX_ERR(1, 520, __pyx_L1_error)
16418 
16419  /* "View.MemoryView":519
16420  * @cname('getbuffer')
16421  * def __getbuffer__(self, Py_buffer *info, int flags):
16422  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
16423  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16424  *
16425  */
16426  }
16427 
16428  /* "View.MemoryView":522
16429  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16430  *
16431  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
16432  * info.shape = self.view.shape
16433  * else:
16434  */
16435  __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
16436  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
16437  if (__pyx_t_1) {
16438 
16439  /* "View.MemoryView":523
16440  *
16441  * if flags & PyBUF_ND:
16442  * info.shape = self.view.shape # <<<<<<<<<<<<<<
16443  * else:
16444  * info.shape = NULL
16445  */
16446  __Pyx_TraceLine(523,0,__PYX_ERR(1, 523, __pyx_L1_error))
16447  __pyx_t_4 = __pyx_v_self->view.shape;
16448  __pyx_v_info->shape = __pyx_t_4;
16449 
16450  /* "View.MemoryView":522
16451  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16452  *
16453  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
16454  * info.shape = self.view.shape
16455  * else:
16456  */
16457  goto __pyx_L6;
16458  }
16459 
16460  /* "View.MemoryView":525
16461  * info.shape = self.view.shape
16462  * else:
16463  * info.shape = NULL # <<<<<<<<<<<<<<
16464  *
16465  * if flags & PyBUF_STRIDES:
16466  */
16467  __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
16468  /*else*/ {
16469  __pyx_v_info->shape = NULL;
16470  }
16471  __pyx_L6:;
16472 
16473  /* "View.MemoryView":527
16474  * info.shape = NULL
16475  *
16476  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
16477  * info.strides = self.view.strides
16478  * else:
16479  */
16480  __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
16481  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
16482  if (__pyx_t_1) {
16483 
16484  /* "View.MemoryView":528
16485  *
16486  * if flags & PyBUF_STRIDES:
16487  * info.strides = self.view.strides # <<<<<<<<<<<<<<
16488  * else:
16489  * info.strides = NULL
16490  */
16491  __Pyx_TraceLine(528,0,__PYX_ERR(1, 528, __pyx_L1_error))
16492  __pyx_t_4 = __pyx_v_self->view.strides;
16493  __pyx_v_info->strides = __pyx_t_4;
16494 
16495  /* "View.MemoryView":527
16496  * info.shape = NULL
16497  *
16498  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
16499  * info.strides = self.view.strides
16500  * else:
16501  */
16502  goto __pyx_L7;
16503  }
16504 
16505  /* "View.MemoryView":530
16506  * info.strides = self.view.strides
16507  * else:
16508  * info.strides = NULL # <<<<<<<<<<<<<<
16509  *
16510  * if flags & PyBUF_INDIRECT:
16511  */
16512  __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
16513  /*else*/ {
16514  __pyx_v_info->strides = NULL;
16515  }
16516  __pyx_L7:;
16517 
16518  /* "View.MemoryView":532
16519  * info.strides = NULL
16520  *
16521  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
16522  * info.suboffsets = self.view.suboffsets
16523  * else:
16524  */
16525  __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
16526  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
16527  if (__pyx_t_1) {
16528 
16529  /* "View.MemoryView":533
16530  *
16531  * if flags & PyBUF_INDIRECT:
16532  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
16533  * else:
16534  * info.suboffsets = NULL
16535  */
16536  __Pyx_TraceLine(533,0,__PYX_ERR(1, 533, __pyx_L1_error))
16537  __pyx_t_4 = __pyx_v_self->view.suboffsets;
16538  __pyx_v_info->suboffsets = __pyx_t_4;
16539 
16540  /* "View.MemoryView":532
16541  * info.strides = NULL
16542  *
16543  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
16544  * info.suboffsets = self.view.suboffsets
16545  * else:
16546  */
16547  goto __pyx_L8;
16548  }
16549 
16550  /* "View.MemoryView":535
16551  * info.suboffsets = self.view.suboffsets
16552  * else:
16553  * info.suboffsets = NULL # <<<<<<<<<<<<<<
16554  *
16555  * if flags & PyBUF_FORMAT:
16556  */
16557  __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
16558  /*else*/ {
16559  __pyx_v_info->suboffsets = NULL;
16560  }
16561  __pyx_L8:;
16562 
16563  /* "View.MemoryView":537
16564  * info.suboffsets = NULL
16565  *
16566  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
16567  * info.format = self.view.format
16568  * else:
16569  */
16570  __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
16571  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
16572  if (__pyx_t_1) {
16573 
16574  /* "View.MemoryView":538
16575  *
16576  * if flags & PyBUF_FORMAT:
16577  * info.format = self.view.format # <<<<<<<<<<<<<<
16578  * else:
16579  * info.format = NULL
16580  */
16581  __Pyx_TraceLine(538,0,__PYX_ERR(1, 538, __pyx_L1_error))
16582  __pyx_t_5 = __pyx_v_self->view.format;
16583  __pyx_v_info->format = __pyx_t_5;
16584 
16585  /* "View.MemoryView":537
16586  * info.suboffsets = NULL
16587  *
16588  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
16589  * info.format = self.view.format
16590  * else:
16591  */
16592  goto __pyx_L9;
16593  }
16594 
16595  /* "View.MemoryView":540
16596  * info.format = self.view.format
16597  * else:
16598  * info.format = NULL # <<<<<<<<<<<<<<
16599  *
16600  * info.buf = self.view.buf
16601  */
16602  __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
16603  /*else*/ {
16604  __pyx_v_info->format = NULL;
16605  }
16606  __pyx_L9:;
16607 
16608  /* "View.MemoryView":542
16609  * info.format = NULL
16610  *
16611  * info.buf = self.view.buf # <<<<<<<<<<<<<<
16612  * info.ndim = self.view.ndim
16613  * info.itemsize = self.view.itemsize
16614  */
16615  __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
16616  __pyx_t_6 = __pyx_v_self->view.buf;
16617  __pyx_v_info->buf = __pyx_t_6;
16618 
16619  /* "View.MemoryView":543
16620  *
16621  * info.buf = self.view.buf
16622  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
16623  * info.itemsize = self.view.itemsize
16624  * info.len = self.view.len
16625  */
16626  __Pyx_TraceLine(543,0,__PYX_ERR(1, 543, __pyx_L1_error))
16627  __pyx_t_7 = __pyx_v_self->view.ndim;
16628  __pyx_v_info->ndim = __pyx_t_7;
16629 
16630  /* "View.MemoryView":544
16631  * info.buf = self.view.buf
16632  * info.ndim = self.view.ndim
16633  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
16634  * info.len = self.view.len
16635  * info.readonly = self.view.readonly
16636  */
16637  __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
16638  __pyx_t_8 = __pyx_v_self->view.itemsize;
16639  __pyx_v_info->itemsize = __pyx_t_8;
16640 
16641  /* "View.MemoryView":545
16642  * info.ndim = self.view.ndim
16643  * info.itemsize = self.view.itemsize
16644  * info.len = self.view.len # <<<<<<<<<<<<<<
16645  * info.readonly = self.view.readonly
16646  * info.obj = self
16647  */
16648  __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
16649  __pyx_t_8 = __pyx_v_self->view.len;
16650  __pyx_v_info->len = __pyx_t_8;
16651 
16652  /* "View.MemoryView":546
16653  * info.itemsize = self.view.itemsize
16654  * info.len = self.view.len
16655  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
16656  * info.obj = self
16657  *
16658  */
16659  __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
16660  __pyx_t_1 = __pyx_v_self->view.readonly;
16661  __pyx_v_info->readonly = __pyx_t_1;
16662 
16663  /* "View.MemoryView":547
16664  * info.len = self.view.len
16665  * info.readonly = self.view.readonly
16666  * info.obj = self # <<<<<<<<<<<<<<
16667  *
16668  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16669  */
16670  __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
16671  __Pyx_INCREF(((PyObject *)__pyx_v_self));
16672  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16673  __Pyx_GOTREF(__pyx_v_info->obj);
16674  __Pyx_DECREF(__pyx_v_info->obj);
16675  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
16676 
16677  /* "View.MemoryView":518
16678  *
16679  * @cname('getbuffer')
16680  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
16681  * if flags & PyBUF_WRITABLE and self.view.readonly:
16682  * raise ValueError("Cannot create writable memory view from read-only memoryview")
16683  */
16684 
16685  /* function exit code */
16686  __pyx_r = 0;
16687  goto __pyx_L0;
16688  __pyx_L1_error:;
16689  __Pyx_XDECREF(__pyx_t_3);
16690  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16691  __pyx_r = -1;
16692  if (__pyx_v_info->obj != NULL) {
16693  __Pyx_GOTREF(__pyx_v_info->obj);
16694  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16695  }
16696  goto __pyx_L2;
16697  __pyx_L0:;
16698  if (__pyx_v_info->obj == Py_None) {
16699  __Pyx_GOTREF(__pyx_v_info->obj);
16700  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16701  }
16702  __pyx_L2:;
16703  __Pyx_TraceReturn(Py_None, 0);
16704  __Pyx_RefNannyFinishContext();
16705  return __pyx_r;
16706 }
16707 
16708 /* "View.MemoryView":553
16709  *
16710  * @property
16711  * def T(self): # <<<<<<<<<<<<<<
16712  * cdef _memoryviewslice result = memoryview_copy(self)
16713  * transpose_memslice(&result.from_slice)
16714  */
16715 
16716 /* Python wrapper */
16717 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
16718 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
16719  PyObject *__pyx_r = 0;
16720  __Pyx_RefNannyDeclarations
16721  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16722  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16723 
16724  /* function exit code */
16725  __Pyx_RefNannyFinishContext();
16726  return __pyx_r;
16727 }
16728 
16729 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16730  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16731  PyObject *__pyx_r = NULL;
16732  __Pyx_TraceDeclarations
16733  __Pyx_RefNannyDeclarations
16734  PyObject *__pyx_t_1 = NULL;
16735  int __pyx_t_2;
16736  int __pyx_lineno = 0;
16737  const char *__pyx_filename = NULL;
16738  int __pyx_clineno = 0;
16739  __Pyx_RefNannySetupContext("__get__", 0);
16740  __Pyx_TraceCall("__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
16741 
16742  /* "View.MemoryView":554
16743  * @property
16744  * def T(self):
16745  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
16746  * transpose_memslice(&result.from_slice)
16747  * return result
16748  */
16749  __Pyx_TraceLine(554,0,__PYX_ERR(1, 554, __pyx_L1_error))
16750  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
16751  __Pyx_GOTREF(__pyx_t_1);
16752  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
16753  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
16754  __pyx_t_1 = 0;
16755 
16756  /* "View.MemoryView":555
16757  * def T(self):
16758  * cdef _memoryviewslice result = memoryview_copy(self)
16759  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
16760  * return result
16761  *
16762  */
16763  __Pyx_TraceLine(555,0,__PYX_ERR(1, 555, __pyx_L1_error))
16764  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
16765 
16766  /* "View.MemoryView":556
16767  * cdef _memoryviewslice result = memoryview_copy(self)
16768  * transpose_memslice(&result.from_slice)
16769  * return result # <<<<<<<<<<<<<<
16770  *
16771  * @property
16772  */
16773  __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
16774  __Pyx_XDECREF(__pyx_r);
16775  __Pyx_INCREF(((PyObject *)__pyx_v_result));
16776  __pyx_r = ((PyObject *)__pyx_v_result);
16777  goto __pyx_L0;
16778 
16779  /* "View.MemoryView":553
16780  *
16781  * @property
16782  * def T(self): # <<<<<<<<<<<<<<
16783  * cdef _memoryviewslice result = memoryview_copy(self)
16784  * transpose_memslice(&result.from_slice)
16785  */
16786 
16787  /* function exit code */
16788  __pyx_L1_error:;
16789  __Pyx_XDECREF(__pyx_t_1);
16790  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16791  __pyx_r = NULL;
16792  __pyx_L0:;
16793  __Pyx_XDECREF((PyObject *)__pyx_v_result);
16794  __Pyx_XGIVEREF(__pyx_r);
16795  __Pyx_TraceReturn(__pyx_r, 0);
16796  __Pyx_RefNannyFinishContext();
16797  return __pyx_r;
16798 }
16799 
16800 /* "View.MemoryView":559
16801  *
16802  * @property
16803  * def base(self): # <<<<<<<<<<<<<<
16804  * return self.obj
16805  *
16806  */
16807 
16808 /* Python wrapper */
16809 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16810 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
16811  PyObject *__pyx_r = 0;
16812  __Pyx_RefNannyDeclarations
16813  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16814  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16815 
16816  /* function exit code */
16817  __Pyx_RefNannyFinishContext();
16818  return __pyx_r;
16819 }
16820 
16821 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16822  PyObject *__pyx_r = NULL;
16823  __Pyx_TraceDeclarations
16824  __Pyx_RefNannyDeclarations
16825  int __pyx_lineno = 0;
16826  const char *__pyx_filename = NULL;
16827  int __pyx_clineno = 0;
16828  __Pyx_RefNannySetupContext("__get__", 0);
16829  __Pyx_TraceCall("__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
16830 
16831  /* "View.MemoryView":560
16832  * @property
16833  * def base(self):
16834  * return self.obj # <<<<<<<<<<<<<<
16835  *
16836  * @property
16837  */
16838  __Pyx_TraceLine(560,0,__PYX_ERR(1, 560, __pyx_L1_error))
16839  __Pyx_XDECREF(__pyx_r);
16840  __Pyx_INCREF(__pyx_v_self->obj);
16841  __pyx_r = __pyx_v_self->obj;
16842  goto __pyx_L0;
16843 
16844  /* "View.MemoryView":559
16845  *
16846  * @property
16847  * def base(self): # <<<<<<<<<<<<<<
16848  * return self.obj
16849  *
16850  */
16851 
16852  /* function exit code */
16853  __pyx_L1_error:;
16854  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16855  __pyx_r = NULL;
16856  __pyx_L0:;
16857  __Pyx_XGIVEREF(__pyx_r);
16858  __Pyx_TraceReturn(__pyx_r, 0);
16859  __Pyx_RefNannyFinishContext();
16860  return __pyx_r;
16861 }
16862 
16863 /* "View.MemoryView":563
16864  *
16865  * @property
16866  * def shape(self): # <<<<<<<<<<<<<<
16867  * return tuple([length for length in self.view.shape[:self.view.ndim]])
16868  *
16869  */
16870 
16871 /* Python wrapper */
16872 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
16873 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
16874  PyObject *__pyx_r = 0;
16875  __Pyx_RefNannyDeclarations
16876  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16877  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16878 
16879  /* function exit code */
16880  __Pyx_RefNannyFinishContext();
16881  return __pyx_r;
16882 }
16883 
16884 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16885  Py_ssize_t __pyx_v_length;
16886  PyObject *__pyx_r = NULL;
16887  __Pyx_TraceDeclarations
16888  __Pyx_RefNannyDeclarations
16889  PyObject *__pyx_t_1 = NULL;
16890  Py_ssize_t *__pyx_t_2;
16891  Py_ssize_t *__pyx_t_3;
16892  Py_ssize_t *__pyx_t_4;
16893  PyObject *__pyx_t_5 = NULL;
16894  int __pyx_lineno = 0;
16895  const char *__pyx_filename = NULL;
16896  int __pyx_clineno = 0;
16897  __Pyx_RefNannySetupContext("__get__", 0);
16898  __Pyx_TraceCall("__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
16899 
16900  /* "View.MemoryView":564
16901  * @property
16902  * def shape(self):
16903  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
16904  *
16905  * @property
16906  */
16907  __Pyx_TraceLine(564,0,__PYX_ERR(1, 564, __pyx_L1_error))
16908  __Pyx_XDECREF(__pyx_r);
16909  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
16910  __Pyx_GOTREF(__pyx_t_1);
16911  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
16912  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16913  __pyx_t_2 = __pyx_t_4;
16914  __pyx_v_length = (__pyx_t_2[0]);
16915  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
16916  __Pyx_GOTREF(__pyx_t_5);
16917  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
16918  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16919  }
16920  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
16921  __Pyx_GOTREF(__pyx_t_5);
16922  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16923  __pyx_r = __pyx_t_5;
16924  __pyx_t_5 = 0;
16925  goto __pyx_L0;
16926 
16927  /* "View.MemoryView":563
16928  *
16929  * @property
16930  * def shape(self): # <<<<<<<<<<<<<<
16931  * return tuple([length for length in self.view.shape[:self.view.ndim]])
16932  *
16933  */
16934 
16935  /* function exit code */
16936  __pyx_L1_error:;
16937  __Pyx_XDECREF(__pyx_t_1);
16938  __Pyx_XDECREF(__pyx_t_5);
16939  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16940  __pyx_r = NULL;
16941  __pyx_L0:;
16942  __Pyx_XGIVEREF(__pyx_r);
16943  __Pyx_TraceReturn(__pyx_r, 0);
16944  __Pyx_RefNannyFinishContext();
16945  return __pyx_r;
16946 }
16947 
16948 /* "View.MemoryView":567
16949  *
16950  * @property
16951  * def strides(self): # <<<<<<<<<<<<<<
16952  * if self.view.strides == NULL:
16953  *
16954  */
16955 
16956 /* Python wrapper */
16957 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
16958 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
16959  PyObject *__pyx_r = 0;
16960  __Pyx_RefNannyDeclarations
16961  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16962  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16963 
16964  /* function exit code */
16965  __Pyx_RefNannyFinishContext();
16966  return __pyx_r;
16967 }
16968 
16969 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16970  Py_ssize_t __pyx_v_stride;
16971  PyObject *__pyx_r = NULL;
16972  __Pyx_TraceDeclarations
16973  __Pyx_RefNannyDeclarations
16974  int __pyx_t_1;
16975  PyObject *__pyx_t_2 = NULL;
16976  Py_ssize_t *__pyx_t_3;
16977  Py_ssize_t *__pyx_t_4;
16978  Py_ssize_t *__pyx_t_5;
16979  PyObject *__pyx_t_6 = NULL;
16980  int __pyx_lineno = 0;
16981  const char *__pyx_filename = NULL;
16982  int __pyx_clineno = 0;
16983  __Pyx_RefNannySetupContext("__get__", 0);
16984  __Pyx_TraceCall("__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
16985 
16986  /* "View.MemoryView":568
16987  * @property
16988  * def strides(self):
16989  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
16990  *
16991  * raise ValueError("Buffer view does not expose strides")
16992  */
16993  __Pyx_TraceLine(568,0,__PYX_ERR(1, 568, __pyx_L1_error))
16994  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
16995  if (unlikely(__pyx_t_1)) {
16996 
16997  /* "View.MemoryView":570
16998  * if self.view.strides == NULL:
16999  *
17000  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
17001  *
17002  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
17003  */
17004  __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
17005  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
17006  __Pyx_GOTREF(__pyx_t_2);
17007  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17008  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17009  __PYX_ERR(1, 570, __pyx_L1_error)
17010 
17011  /* "View.MemoryView":568
17012  * @property
17013  * def strides(self):
17014  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
17015  *
17016  * raise ValueError("Buffer view does not expose strides")
17017  */
17018  }
17019 
17020  /* "View.MemoryView":572
17021  * raise ValueError("Buffer view does not expose strides")
17022  *
17023  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
17024  *
17025  * @property
17026  */
17027  __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
17028  __Pyx_XDECREF(__pyx_r);
17029  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
17030  __Pyx_GOTREF(__pyx_t_2);
17031  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
17032  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17033  __pyx_t_3 = __pyx_t_5;
17034  __pyx_v_stride = (__pyx_t_3[0]);
17035  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
17036  __Pyx_GOTREF(__pyx_t_6);
17037  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
17038  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17039  }
17040  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
17041  __Pyx_GOTREF(__pyx_t_6);
17042  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17043  __pyx_r = __pyx_t_6;
17044  __pyx_t_6 = 0;
17045  goto __pyx_L0;
17046 
17047  /* "View.MemoryView":567
17048  *
17049  * @property
17050  * def strides(self): # <<<<<<<<<<<<<<
17051  * if self.view.strides == NULL:
17052  *
17053  */
17054 
17055  /* function exit code */
17056  __pyx_L1_error:;
17057  __Pyx_XDECREF(__pyx_t_2);
17058  __Pyx_XDECREF(__pyx_t_6);
17059  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17060  __pyx_r = NULL;
17061  __pyx_L0:;
17062  __Pyx_XGIVEREF(__pyx_r);
17063  __Pyx_TraceReturn(__pyx_r, 0);
17064  __Pyx_RefNannyFinishContext();
17065  return __pyx_r;
17066 }
17067 
17068 /* "View.MemoryView":575
17069  *
17070  * @property
17071  * def suboffsets(self): # <<<<<<<<<<<<<<
17072  * if self.view.suboffsets == NULL:
17073  * return (-1,) * self.view.ndim
17074  */
17075 
17076 /* Python wrapper */
17077 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
17078 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
17079  PyObject *__pyx_r = 0;
17080  __Pyx_RefNannyDeclarations
17081  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17082  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17083 
17084  /* function exit code */
17085  __Pyx_RefNannyFinishContext();
17086  return __pyx_r;
17087 }
17088 
17089 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17090  Py_ssize_t __pyx_v_suboffset;
17091  PyObject *__pyx_r = NULL;
17092  __Pyx_TraceDeclarations
17093  __Pyx_RefNannyDeclarations
17094  int __pyx_t_1;
17095  PyObject *__pyx_t_2 = NULL;
17096  PyObject *__pyx_t_3 = NULL;
17097  Py_ssize_t *__pyx_t_4;
17098  Py_ssize_t *__pyx_t_5;
17099  Py_ssize_t *__pyx_t_6;
17100  int __pyx_lineno = 0;
17101  const char *__pyx_filename = NULL;
17102  int __pyx_clineno = 0;
17103  __Pyx_RefNannySetupContext("__get__", 0);
17104  __Pyx_TraceCall("__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
17105 
17106  /* "View.MemoryView":576
17107  * @property
17108  * def suboffsets(self):
17109  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
17110  * return (-1,) * self.view.ndim
17111  *
17112  */
17113  __Pyx_TraceLine(576,0,__PYX_ERR(1, 576, __pyx_L1_error))
17114  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
17115  if (__pyx_t_1) {
17116 
17117  /* "View.MemoryView":577
17118  * def suboffsets(self):
17119  * if self.view.suboffsets == NULL:
17120  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
17121  *
17122  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
17123  */
17124  __Pyx_TraceLine(577,0,__PYX_ERR(1, 577, __pyx_L1_error))
17125  __Pyx_XDECREF(__pyx_r);
17126  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
17127  __Pyx_GOTREF(__pyx_t_2);
17128  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__33, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
17129  __Pyx_GOTREF(__pyx_t_3);
17130  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17131  __pyx_r = __pyx_t_3;
17132  __pyx_t_3 = 0;
17133  goto __pyx_L0;
17134 
17135  /* "View.MemoryView":576
17136  * @property
17137  * def suboffsets(self):
17138  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
17139  * return (-1,) * self.view.ndim
17140  *
17141  */
17142  }
17143 
17144  /* "View.MemoryView":579
17145  * return (-1,) * self.view.ndim
17146  *
17147  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
17148  *
17149  * @property
17150  */
17151  __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
17152  __Pyx_XDECREF(__pyx_r);
17153  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
17154  __Pyx_GOTREF(__pyx_t_3);
17155  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
17156  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
17157  __pyx_t_4 = __pyx_t_6;
17158  __pyx_v_suboffset = (__pyx_t_4[0]);
17159  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
17160  __Pyx_GOTREF(__pyx_t_2);
17161  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
17162  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17163  }
17164  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
17165  __Pyx_GOTREF(__pyx_t_2);
17166  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17167  __pyx_r = __pyx_t_2;
17168  __pyx_t_2 = 0;
17169  goto __pyx_L0;
17170 
17171  /* "View.MemoryView":575
17172  *
17173  * @property
17174  * def suboffsets(self): # <<<<<<<<<<<<<<
17175  * if self.view.suboffsets == NULL:
17176  * return (-1,) * self.view.ndim
17177  */
17178 
17179  /* function exit code */
17180  __pyx_L1_error:;
17181  __Pyx_XDECREF(__pyx_t_2);
17182  __Pyx_XDECREF(__pyx_t_3);
17183  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17184  __pyx_r = NULL;
17185  __pyx_L0:;
17186  __Pyx_XGIVEREF(__pyx_r);
17187  __Pyx_TraceReturn(__pyx_r, 0);
17188  __Pyx_RefNannyFinishContext();
17189  return __pyx_r;
17190 }
17191 
17192 /* "View.MemoryView":582
17193  *
17194  * @property
17195  * def ndim(self): # <<<<<<<<<<<<<<
17196  * return self.view.ndim
17197  *
17198  */
17199 
17200 /* Python wrapper */
17201 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
17202 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
17203  PyObject *__pyx_r = 0;
17204  __Pyx_RefNannyDeclarations
17205  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17206  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17207 
17208  /* function exit code */
17209  __Pyx_RefNannyFinishContext();
17210  return __pyx_r;
17211 }
17212 
17213 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17214  PyObject *__pyx_r = NULL;
17215  __Pyx_TraceDeclarations
17216  __Pyx_RefNannyDeclarations
17217  PyObject *__pyx_t_1 = NULL;
17218  int __pyx_lineno = 0;
17219  const char *__pyx_filename = NULL;
17220  int __pyx_clineno = 0;
17221  __Pyx_RefNannySetupContext("__get__", 0);
17222  __Pyx_TraceCall("__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
17223 
17224  /* "View.MemoryView":583
17225  * @property
17226  * def ndim(self):
17227  * return self.view.ndim # <<<<<<<<<<<<<<
17228  *
17229  * @property
17230  */
17231  __Pyx_TraceLine(583,0,__PYX_ERR(1, 583, __pyx_L1_error))
17232  __Pyx_XDECREF(__pyx_r);
17233  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
17234  __Pyx_GOTREF(__pyx_t_1);
17235  __pyx_r = __pyx_t_1;
17236  __pyx_t_1 = 0;
17237  goto __pyx_L0;
17238 
17239  /* "View.MemoryView":582
17240  *
17241  * @property
17242  * def ndim(self): # <<<<<<<<<<<<<<
17243  * return self.view.ndim
17244  *
17245  */
17246 
17247  /* function exit code */
17248  __pyx_L1_error:;
17249  __Pyx_XDECREF(__pyx_t_1);
17250  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17251  __pyx_r = NULL;
17252  __pyx_L0:;
17253  __Pyx_XGIVEREF(__pyx_r);
17254  __Pyx_TraceReturn(__pyx_r, 0);
17255  __Pyx_RefNannyFinishContext();
17256  return __pyx_r;
17257 }
17258 
17259 /* "View.MemoryView":586
17260  *
17261  * @property
17262  * def itemsize(self): # <<<<<<<<<<<<<<
17263  * return self.view.itemsize
17264  *
17265  */
17266 
17267 /* Python wrapper */
17268 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
17269 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
17270  PyObject *__pyx_r = 0;
17271  __Pyx_RefNannyDeclarations
17272  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17273  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17274 
17275  /* function exit code */
17276  __Pyx_RefNannyFinishContext();
17277  return __pyx_r;
17278 }
17279 
17280 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17281  PyObject *__pyx_r = NULL;
17282  __Pyx_TraceDeclarations
17283  __Pyx_RefNannyDeclarations
17284  PyObject *__pyx_t_1 = NULL;
17285  int __pyx_lineno = 0;
17286  const char *__pyx_filename = NULL;
17287  int __pyx_clineno = 0;
17288  __Pyx_RefNannySetupContext("__get__", 0);
17289  __Pyx_TraceCall("__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
17290 
17291  /* "View.MemoryView":587
17292  * @property
17293  * def itemsize(self):
17294  * return self.view.itemsize # <<<<<<<<<<<<<<
17295  *
17296  * @property
17297  */
17298  __Pyx_TraceLine(587,0,__PYX_ERR(1, 587, __pyx_L1_error))
17299  __Pyx_XDECREF(__pyx_r);
17300  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
17301  __Pyx_GOTREF(__pyx_t_1);
17302  __pyx_r = __pyx_t_1;
17303  __pyx_t_1 = 0;
17304  goto __pyx_L0;
17305 
17306  /* "View.MemoryView":586
17307  *
17308  * @property
17309  * def itemsize(self): # <<<<<<<<<<<<<<
17310  * return self.view.itemsize
17311  *
17312  */
17313 
17314  /* function exit code */
17315  __pyx_L1_error:;
17316  __Pyx_XDECREF(__pyx_t_1);
17317  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17318  __pyx_r = NULL;
17319  __pyx_L0:;
17320  __Pyx_XGIVEREF(__pyx_r);
17321  __Pyx_TraceReturn(__pyx_r, 0);
17322  __Pyx_RefNannyFinishContext();
17323  return __pyx_r;
17324 }
17325 
17326 /* "View.MemoryView":590
17327  *
17328  * @property
17329  * def nbytes(self): # <<<<<<<<<<<<<<
17330  * return self.size * self.view.itemsize
17331  *
17332  */
17333 
17334 /* Python wrapper */
17335 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
17336 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
17337  PyObject *__pyx_r = 0;
17338  __Pyx_RefNannyDeclarations
17339  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17340  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17341 
17342  /* function exit code */
17343  __Pyx_RefNannyFinishContext();
17344  return __pyx_r;
17345 }
17346 
17347 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17348  PyObject *__pyx_r = NULL;
17349  __Pyx_TraceDeclarations
17350  __Pyx_RefNannyDeclarations
17351  PyObject *__pyx_t_1 = NULL;
17352  PyObject *__pyx_t_2 = NULL;
17353  PyObject *__pyx_t_3 = NULL;
17354  int __pyx_lineno = 0;
17355  const char *__pyx_filename = NULL;
17356  int __pyx_clineno = 0;
17357  __Pyx_RefNannySetupContext("__get__", 0);
17358  __Pyx_TraceCall("__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
17359 
17360  /* "View.MemoryView":591
17361  * @property
17362  * def nbytes(self):
17363  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
17364  *
17365  * @property
17366  */
17367  __Pyx_TraceLine(591,0,__PYX_ERR(1, 591, __pyx_L1_error))
17368  __Pyx_XDECREF(__pyx_r);
17369  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
17370  __Pyx_GOTREF(__pyx_t_1);
17371  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
17372  __Pyx_GOTREF(__pyx_t_2);
17373  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
17374  __Pyx_GOTREF(__pyx_t_3);
17375  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17376  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17377  __pyx_r = __pyx_t_3;
17378  __pyx_t_3 = 0;
17379  goto __pyx_L0;
17380 
17381  /* "View.MemoryView":590
17382  *
17383  * @property
17384  * def nbytes(self): # <<<<<<<<<<<<<<
17385  * return self.size * self.view.itemsize
17386  *
17387  */
17388 
17389  /* function exit code */
17390  __pyx_L1_error:;
17391  __Pyx_XDECREF(__pyx_t_1);
17392  __Pyx_XDECREF(__pyx_t_2);
17393  __Pyx_XDECREF(__pyx_t_3);
17394  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17395  __pyx_r = NULL;
17396  __pyx_L0:;
17397  __Pyx_XGIVEREF(__pyx_r);
17398  __Pyx_TraceReturn(__pyx_r, 0);
17399  __Pyx_RefNannyFinishContext();
17400  return __pyx_r;
17401 }
17402 
17403 /* "View.MemoryView":594
17404  *
17405  * @property
17406  * def size(self): # <<<<<<<<<<<<<<
17407  * if self._size is None:
17408  * result = 1
17409  */
17410 
17411 /* Python wrapper */
17412 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
17413 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
17414  PyObject *__pyx_r = 0;
17415  __Pyx_RefNannyDeclarations
17416  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17417  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17418 
17419  /* function exit code */
17420  __Pyx_RefNannyFinishContext();
17421  return __pyx_r;
17422 }
17423 
17424 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17425  PyObject *__pyx_v_result = NULL;
17426  PyObject *__pyx_v_length = NULL;
17427  PyObject *__pyx_r = NULL;
17428  __Pyx_TraceDeclarations
17429  __Pyx_RefNannyDeclarations
17430  int __pyx_t_1;
17431  int __pyx_t_2;
17432  Py_ssize_t *__pyx_t_3;
17433  Py_ssize_t *__pyx_t_4;
17434  Py_ssize_t *__pyx_t_5;
17435  PyObject *__pyx_t_6 = NULL;
17436  int __pyx_lineno = 0;
17437  const char *__pyx_filename = NULL;
17438  int __pyx_clineno = 0;
17439  __Pyx_RefNannySetupContext("__get__", 0);
17440  __Pyx_TraceCall("__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
17441 
17442  /* "View.MemoryView":595
17443  * @property
17444  * def size(self):
17445  * if self._size is None: # <<<<<<<<<<<<<<
17446  * result = 1
17447  *
17448  */
17449  __Pyx_TraceLine(595,0,__PYX_ERR(1, 595, __pyx_L1_error))
17450  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
17451  __pyx_t_2 = (__pyx_t_1 != 0);
17452  if (__pyx_t_2) {
17453 
17454  /* "View.MemoryView":596
17455  * def size(self):
17456  * if self._size is None:
17457  * result = 1 # <<<<<<<<<<<<<<
17458  *
17459  * for length in self.view.shape[:self.view.ndim]:
17460  */
17461  __Pyx_TraceLine(596,0,__PYX_ERR(1, 596, __pyx_L1_error))
17462  __Pyx_INCREF(__pyx_int_1);
17463  __pyx_v_result = __pyx_int_1;
17464 
17465  /* "View.MemoryView":598
17466  * result = 1
17467  *
17468  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
17469  * result *= length
17470  *
17471  */
17472  __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
17473  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17474  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17475  __pyx_t_3 = __pyx_t_5;
17476  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
17477  __Pyx_GOTREF(__pyx_t_6);
17478  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
17479  __pyx_t_6 = 0;
17480 
17481  /* "View.MemoryView":599
17482  *
17483  * for length in self.view.shape[:self.view.ndim]:
17484  * result *= length # <<<<<<<<<<<<<<
17485  *
17486  * self._size = result
17487  */
17488  __Pyx_TraceLine(599,0,__PYX_ERR(1, 599, __pyx_L1_error))
17489  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
17490  __Pyx_GOTREF(__pyx_t_6);
17491  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
17492  __pyx_t_6 = 0;
17493  }
17494 
17495  /* "View.MemoryView":601
17496  * result *= length
17497  *
17498  * self._size = result # <<<<<<<<<<<<<<
17499  *
17500  * return self._size
17501  */
17502  __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
17503  __Pyx_INCREF(__pyx_v_result);
17504  __Pyx_GIVEREF(__pyx_v_result);
17505  __Pyx_GOTREF(__pyx_v_self->_size);
17506  __Pyx_DECREF(__pyx_v_self->_size);
17507  __pyx_v_self->_size = __pyx_v_result;
17508 
17509  /* "View.MemoryView":595
17510  * @property
17511  * def size(self):
17512  * if self._size is None: # <<<<<<<<<<<<<<
17513  * result = 1
17514  *
17515  */
17516  }
17517 
17518  /* "View.MemoryView":603
17519  * self._size = result
17520  *
17521  * return self._size # <<<<<<<<<<<<<<
17522  *
17523  * def __len__(self):
17524  */
17525  __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
17526  __Pyx_XDECREF(__pyx_r);
17527  __Pyx_INCREF(__pyx_v_self->_size);
17528  __pyx_r = __pyx_v_self->_size;
17529  goto __pyx_L0;
17530 
17531  /* "View.MemoryView":594
17532  *
17533  * @property
17534  * def size(self): # <<<<<<<<<<<<<<
17535  * if self._size is None:
17536  * result = 1
17537  */
17538 
17539  /* function exit code */
17540  __pyx_L1_error:;
17541  __Pyx_XDECREF(__pyx_t_6);
17542  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17543  __pyx_r = NULL;
17544  __pyx_L0:;
17545  __Pyx_XDECREF(__pyx_v_result);
17546  __Pyx_XDECREF(__pyx_v_length);
17547  __Pyx_XGIVEREF(__pyx_r);
17548  __Pyx_TraceReturn(__pyx_r, 0);
17549  __Pyx_RefNannyFinishContext();
17550  return __pyx_r;
17551 }
17552 
17553 /* "View.MemoryView":605
17554  * return self._size
17555  *
17556  * def __len__(self): # <<<<<<<<<<<<<<
17557  * if self.view.ndim >= 1:
17558  * return self.view.shape[0]
17559  */
17560 
17561 /* Python wrapper */
17562 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
17563 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
17564  Py_ssize_t __pyx_r;
17565  __Pyx_RefNannyDeclarations
17566  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
17567  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17568 
17569  /* function exit code */
17570  __Pyx_RefNannyFinishContext();
17571  return __pyx_r;
17572 }
17573 
17574 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
17575  Py_ssize_t __pyx_r;
17576  __Pyx_TraceDeclarations
17577  __Pyx_RefNannyDeclarations
17578  int __pyx_t_1;
17579  int __pyx_lineno = 0;
17580  const char *__pyx_filename = NULL;
17581  int __pyx_clineno = 0;
17582  __Pyx_RefNannySetupContext("__len__", 0);
17583  __Pyx_TraceCall("__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
17584 
17585  /* "View.MemoryView":606
17586  *
17587  * def __len__(self):
17588  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
17589  * return self.view.shape[0]
17590  *
17591  */
17592  __Pyx_TraceLine(606,0,__PYX_ERR(1, 606, __pyx_L1_error))
17593  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
17594  if (__pyx_t_1) {
17595 
17596  /* "View.MemoryView":607
17597  * def __len__(self):
17598  * if self.view.ndim >= 1:
17599  * return self.view.shape[0] # <<<<<<<<<<<<<<
17600  *
17601  * return 0
17602  */
17603  __Pyx_TraceLine(607,0,__PYX_ERR(1, 607, __pyx_L1_error))
17604  __pyx_r = (__pyx_v_self->view.shape[0]);
17605  goto __pyx_L0;
17606 
17607  /* "View.MemoryView":606
17608  *
17609  * def __len__(self):
17610  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
17611  * return self.view.shape[0]
17612  *
17613  */
17614  }
17615 
17616  /* "View.MemoryView":609
17617  * return self.view.shape[0]
17618  *
17619  * return 0 # <<<<<<<<<<<<<<
17620  *
17621  * def __repr__(self):
17622  */
17623  __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
17624  __pyx_r = 0;
17625  goto __pyx_L0;
17626 
17627  /* "View.MemoryView":605
17628  * return self._size
17629  *
17630  * def __len__(self): # <<<<<<<<<<<<<<
17631  * if self.view.ndim >= 1:
17632  * return self.view.shape[0]
17633  */
17634 
17635  /* function exit code */
17636  __pyx_L1_error:;
17637  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17638  __pyx_r = -1;
17639  __pyx_L0:;
17640  __Pyx_TraceReturn(Py_None, 0);
17641  __Pyx_RefNannyFinishContext();
17642  return __pyx_r;
17643 }
17644 
17645 /* "View.MemoryView":611
17646  * return 0
17647  *
17648  * def __repr__(self): # <<<<<<<<<<<<<<
17649  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17650  * id(self))
17651  */
17652 
17653 /* Python wrapper */
17654 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
17655 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
17656  PyObject *__pyx_r = 0;
17657  __Pyx_RefNannyDeclarations
17658  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
17659  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17660 
17661  /* function exit code */
17662  __Pyx_RefNannyFinishContext();
17663  return __pyx_r;
17664 }
17665 
17666 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
17667  PyObject *__pyx_r = NULL;
17668  __Pyx_TraceDeclarations
17669  __Pyx_RefNannyDeclarations
17670  PyObject *__pyx_t_1 = NULL;
17671  PyObject *__pyx_t_2 = NULL;
17672  PyObject *__pyx_t_3 = NULL;
17673  int __pyx_lineno = 0;
17674  const char *__pyx_filename = NULL;
17675  int __pyx_clineno = 0;
17676  __Pyx_RefNannySetupContext("__repr__", 0);
17677  __Pyx_TraceCall("__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
17678 
17679  /* "View.MemoryView":612
17680  *
17681  * def __repr__(self):
17682  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
17683  * id(self))
17684  *
17685  */
17686  __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
17687  __Pyx_XDECREF(__pyx_r);
17688  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
17689  __Pyx_GOTREF(__pyx_t_1);
17690  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
17691  __Pyx_GOTREF(__pyx_t_2);
17692  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17693  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
17694  __Pyx_GOTREF(__pyx_t_1);
17695  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17696 
17697  /* "View.MemoryView":613
17698  * def __repr__(self):
17699  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17700  * id(self)) # <<<<<<<<<<<<<<
17701  *
17702  * def __str__(self):
17703  */
17704  __Pyx_TraceLine(613,0,__PYX_ERR(1, 613, __pyx_L1_error))
17705  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
17706  __Pyx_GOTREF(__pyx_t_2);
17707 
17708  /* "View.MemoryView":612
17709  *
17710  * def __repr__(self):
17711  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
17712  * id(self))
17713  *
17714  */
17715  __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
17716  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
17717  __Pyx_GOTREF(__pyx_t_3);
17718  __Pyx_GIVEREF(__pyx_t_1);
17719  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17720  __Pyx_GIVEREF(__pyx_t_2);
17721  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17722  __pyx_t_1 = 0;
17723  __pyx_t_2 = 0;
17724  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
17725  __Pyx_GOTREF(__pyx_t_2);
17726  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17727  __pyx_r = __pyx_t_2;
17728  __pyx_t_2 = 0;
17729  goto __pyx_L0;
17730 
17731  /* "View.MemoryView":611
17732  * return 0
17733  *
17734  * def __repr__(self): # <<<<<<<<<<<<<<
17735  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17736  * id(self))
17737  */
17738 
17739  /* function exit code */
17740  __pyx_L1_error:;
17741  __Pyx_XDECREF(__pyx_t_1);
17742  __Pyx_XDECREF(__pyx_t_2);
17743  __Pyx_XDECREF(__pyx_t_3);
17744  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17745  __pyx_r = NULL;
17746  __pyx_L0:;
17747  __Pyx_XGIVEREF(__pyx_r);
17748  __Pyx_TraceReturn(__pyx_r, 0);
17749  __Pyx_RefNannyFinishContext();
17750  return __pyx_r;
17751 }
17752 
17753 /* "View.MemoryView":615
17754  * id(self))
17755  *
17756  * def __str__(self): # <<<<<<<<<<<<<<
17757  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
17758  *
17759  */
17760 
17761 /* Python wrapper */
17762 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
17763 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
17764  PyObject *__pyx_r = 0;
17765  __Pyx_RefNannyDeclarations
17766  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
17767  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17768 
17769  /* function exit code */
17770  __Pyx_RefNannyFinishContext();
17771  return __pyx_r;
17772 }
17773 
17774 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
17775  PyObject *__pyx_r = NULL;
17776  __Pyx_TraceDeclarations
17777  __Pyx_RefNannyDeclarations
17778  PyObject *__pyx_t_1 = NULL;
17779  PyObject *__pyx_t_2 = NULL;
17780  int __pyx_lineno = 0;
17781  const char *__pyx_filename = NULL;
17782  int __pyx_clineno = 0;
17783  __Pyx_RefNannySetupContext("__str__", 0);
17784  __Pyx_TraceCall("__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
17785 
17786  /* "View.MemoryView":616
17787  *
17788  * def __str__(self):
17789  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
17790  *
17791  *
17792  */
17793  __Pyx_TraceLine(616,0,__PYX_ERR(1, 616, __pyx_L1_error))
17794  __Pyx_XDECREF(__pyx_r);
17795  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17796  __Pyx_GOTREF(__pyx_t_1);
17797  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
17798  __Pyx_GOTREF(__pyx_t_2);
17799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17800  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17801  __Pyx_GOTREF(__pyx_t_1);
17802  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17803  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
17804  __Pyx_GOTREF(__pyx_t_2);
17805  __Pyx_GIVEREF(__pyx_t_1);
17806  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
17807  __pyx_t_1 = 0;
17808  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17809  __Pyx_GOTREF(__pyx_t_1);
17810  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17811  __pyx_r = __pyx_t_1;
17812  __pyx_t_1 = 0;
17813  goto __pyx_L0;
17814 
17815  /* "View.MemoryView":615
17816  * id(self))
17817  *
17818  * def __str__(self): # <<<<<<<<<<<<<<
17819  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
17820  *
17821  */
17822 
17823  /* function exit code */
17824  __pyx_L1_error:;
17825  __Pyx_XDECREF(__pyx_t_1);
17826  __Pyx_XDECREF(__pyx_t_2);
17827  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17828  __pyx_r = NULL;
17829  __pyx_L0:;
17830  __Pyx_XGIVEREF(__pyx_r);
17831  __Pyx_TraceReturn(__pyx_r, 0);
17832  __Pyx_RefNannyFinishContext();
17833  return __pyx_r;
17834 }
17835 
17836 /* "View.MemoryView":619
17837  *
17838  *
17839  * def is_c_contig(self): # <<<<<<<<<<<<<<
17840  * cdef __Pyx_memviewslice *mslice
17841  * cdef __Pyx_memviewslice tmp
17842  */
17843 
17844 /* Python wrapper */
17845 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17846 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
17847 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17848  PyObject *__pyx_r = 0;
17849  __Pyx_RefNannyDeclarations
17850  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
17851  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
17852 
17853  /* function exit code */
17854  __Pyx_RefNannyFinishContext();
17855  return __pyx_r;
17856 }
17857 
17858 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
17859  __Pyx_memviewslice *__pyx_v_mslice;
17860  __Pyx_memviewslice __pyx_v_tmp;
17861  PyObject *__pyx_r = NULL;
17862  __Pyx_TraceDeclarations
17863  __Pyx_RefNannyDeclarations
17864  __Pyx_memviewslice *__pyx_t_1;
17865  PyObject *__pyx_t_2 = NULL;
17866  int __pyx_lineno = 0;
17867  const char *__pyx_filename = NULL;
17868  int __pyx_clineno = 0;
17869  __Pyx_RefNannySetupContext("is_c_contig", 0);
17870  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
17871 
17872  /* "View.MemoryView":622
17873  * cdef __Pyx_memviewslice *mslice
17874  * cdef __Pyx_memviewslice tmp
17875  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
17876  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
17877  *
17878  */
17879  __Pyx_TraceLine(622,0,__PYX_ERR(1, 622, __pyx_L1_error))
17880  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
17881  __pyx_v_mslice = __pyx_t_1;
17882 
17883  /* "View.MemoryView":623
17884  * cdef __Pyx_memviewslice tmp
17885  * mslice = get_slice_from_memview(self, &tmp)
17886  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
17887  *
17888  * def is_f_contig(self):
17889  */
17890  __Pyx_TraceLine(623,0,__PYX_ERR(1, 623, __pyx_L1_error))
17891  __Pyx_XDECREF(__pyx_r);
17892  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
17893  __Pyx_GOTREF(__pyx_t_2);
17894  __pyx_r = __pyx_t_2;
17895  __pyx_t_2 = 0;
17896  goto __pyx_L0;
17897 
17898  /* "View.MemoryView":619
17899  *
17900  *
17901  * def is_c_contig(self): # <<<<<<<<<<<<<<
17902  * cdef __Pyx_memviewslice *mslice
17903  * cdef __Pyx_memviewslice tmp
17904  */
17905 
17906  /* function exit code */
17907  __pyx_L1_error:;
17908  __Pyx_XDECREF(__pyx_t_2);
17909  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
17910  __pyx_r = NULL;
17911  __pyx_L0:;
17912  __Pyx_XGIVEREF(__pyx_r);
17913  __Pyx_TraceReturn(__pyx_r, 0);
17914  __Pyx_RefNannyFinishContext();
17915  return __pyx_r;
17916 }
17917 
17918 /* "View.MemoryView":625
17919  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
17920  *
17921  * def is_f_contig(self): # <<<<<<<<<<<<<<
17922  * cdef __Pyx_memviewslice *mslice
17923  * cdef __Pyx_memviewslice tmp
17924  */
17925 
17926 /* Python wrapper */
17927 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17928 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
17929 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17930  PyObject *__pyx_r = 0;
17931  __Pyx_RefNannyDeclarations
17932  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
17933  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
17934 
17935  /* function exit code */
17936  __Pyx_RefNannyFinishContext();
17937  return __pyx_r;
17938 }
17939 
17940 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
17941  __Pyx_memviewslice *__pyx_v_mslice;
17942  __Pyx_memviewslice __pyx_v_tmp;
17943  PyObject *__pyx_r = NULL;
17944  __Pyx_TraceDeclarations
17945  __Pyx_RefNannyDeclarations
17946  __Pyx_memviewslice *__pyx_t_1;
17947  PyObject *__pyx_t_2 = NULL;
17948  int __pyx_lineno = 0;
17949  const char *__pyx_filename = NULL;
17950  int __pyx_clineno = 0;
17951  __Pyx_RefNannySetupContext("is_f_contig", 0);
17952  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
17953 
17954  /* "View.MemoryView":628
17955  * cdef __Pyx_memviewslice *mslice
17956  * cdef __Pyx_memviewslice tmp
17957  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
17958  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
17959  *
17960  */
17961  __Pyx_TraceLine(628,0,__PYX_ERR(1, 628, __pyx_L1_error))
17962  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
17963  __pyx_v_mslice = __pyx_t_1;
17964 
17965  /* "View.MemoryView":629
17966  * cdef __Pyx_memviewslice tmp
17967  * mslice = get_slice_from_memview(self, &tmp)
17968  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
17969  *
17970  * def copy(self):
17971  */
17972  __Pyx_TraceLine(629,0,__PYX_ERR(1, 629, __pyx_L1_error))
17973  __Pyx_XDECREF(__pyx_r);
17974  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
17975  __Pyx_GOTREF(__pyx_t_2);
17976  __pyx_r = __pyx_t_2;
17977  __pyx_t_2 = 0;
17978  goto __pyx_L0;
17979 
17980  /* "View.MemoryView":625
17981  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
17982  *
17983  * def is_f_contig(self): # <<<<<<<<<<<<<<
17984  * cdef __Pyx_memviewslice *mslice
17985  * cdef __Pyx_memviewslice tmp
17986  */
17987 
17988  /* function exit code */
17989  __pyx_L1_error:;
17990  __Pyx_XDECREF(__pyx_t_2);
17991  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
17992  __pyx_r = NULL;
17993  __pyx_L0:;
17994  __Pyx_XGIVEREF(__pyx_r);
17995  __Pyx_TraceReturn(__pyx_r, 0);
17996  __Pyx_RefNannyFinishContext();
17997  return __pyx_r;
17998 }
17999 
18000 /* "View.MemoryView":631
18001  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
18002  *
18003  * def copy(self): # <<<<<<<<<<<<<<
18004  * cdef __Pyx_memviewslice mslice
18005  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18006  */
18007 
18008 /* Python wrapper */
18009 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18010 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
18011 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18012  PyObject *__pyx_r = 0;
18013  __Pyx_RefNannyDeclarations
18014  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
18015  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
18016 
18017  /* function exit code */
18018  __Pyx_RefNannyFinishContext();
18019  return __pyx_r;
18020 }
18021 
18022 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
18023  __Pyx_memviewslice __pyx_v_mslice;
18024  int __pyx_v_flags;
18025  PyObject *__pyx_r = NULL;
18026  __Pyx_TraceDeclarations
18027  __Pyx_RefNannyDeclarations
18028  __Pyx_memviewslice __pyx_t_1;
18029  PyObject *__pyx_t_2 = NULL;
18030  int __pyx_lineno = 0;
18031  const char *__pyx_filename = NULL;
18032  int __pyx_clineno = 0;
18033  __Pyx_RefNannySetupContext("copy", 0);
18034  __Pyx_TraceCall("copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
18035 
18036  /* "View.MemoryView":633
18037  * def copy(self):
18038  * cdef __Pyx_memviewslice mslice
18039  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
18040  *
18041  * slice_copy(self, &mslice)
18042  */
18043  __Pyx_TraceLine(633,0,__PYX_ERR(1, 633, __pyx_L1_error))
18044  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
18045 
18046  /* "View.MemoryView":635
18047  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18048  *
18049  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
18050  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
18051  * self.view.itemsize,
18052  */
18053  __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
18054  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
18055 
18056  /* "View.MemoryView":636
18057  *
18058  * slice_copy(self, &mslice)
18059  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
18060  * self.view.itemsize,
18061  * flags|PyBUF_C_CONTIGUOUS,
18062  */
18063  __Pyx_TraceLine(636,0,__PYX_ERR(1, 636, __pyx_L1_error))
18064  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
18065  __pyx_v_mslice = __pyx_t_1;
18066 
18067  /* "View.MemoryView":641
18068  * self.dtype_is_object)
18069  *
18070  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
18071  *
18072  * def copy_fortran(self):
18073  */
18074  __Pyx_TraceLine(641,0,__PYX_ERR(1, 641, __pyx_L1_error))
18075  __Pyx_XDECREF(__pyx_r);
18076  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
18077  __Pyx_GOTREF(__pyx_t_2);
18078  __pyx_r = __pyx_t_2;
18079  __pyx_t_2 = 0;
18080  goto __pyx_L0;
18081 
18082  /* "View.MemoryView":631
18083  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
18084  *
18085  * def copy(self): # <<<<<<<<<<<<<<
18086  * cdef __Pyx_memviewslice mslice
18087  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18088  */
18089 
18090  /* function exit code */
18091  __pyx_L1_error:;
18092  __Pyx_XDECREF(__pyx_t_2);
18093  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18094  __pyx_r = NULL;
18095  __pyx_L0:;
18096  __Pyx_XGIVEREF(__pyx_r);
18097  __Pyx_TraceReturn(__pyx_r, 0);
18098  __Pyx_RefNannyFinishContext();
18099  return __pyx_r;
18100 }
18101 
18102 /* "View.MemoryView":643
18103  * return memoryview_copy_from_slice(self, &mslice)
18104  *
18105  * def copy_fortran(self): # <<<<<<<<<<<<<<
18106  * cdef __Pyx_memviewslice src, dst
18107  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18108  */
18109 
18110 /* Python wrapper */
18111 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18112 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
18113 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18114  PyObject *__pyx_r = 0;
18115  __Pyx_RefNannyDeclarations
18116  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
18117  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
18118 
18119  /* function exit code */
18120  __Pyx_RefNannyFinishContext();
18121  return __pyx_r;
18122 }
18123 
18124 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
18125  __Pyx_memviewslice __pyx_v_src;
18126  __Pyx_memviewslice __pyx_v_dst;
18127  int __pyx_v_flags;
18128  PyObject *__pyx_r = NULL;
18129  __Pyx_TraceDeclarations
18130  __Pyx_RefNannyDeclarations
18131  __Pyx_memviewslice __pyx_t_1;
18132  PyObject *__pyx_t_2 = NULL;
18133  int __pyx_lineno = 0;
18134  const char *__pyx_filename = NULL;
18135  int __pyx_clineno = 0;
18136  __Pyx_RefNannySetupContext("copy_fortran", 0);
18137  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
18138 
18139  /* "View.MemoryView":645
18140  * def copy_fortran(self):
18141  * cdef __Pyx_memviewslice src, dst
18142  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
18143  *
18144  * slice_copy(self, &src)
18145  */
18146  __Pyx_TraceLine(645,0,__PYX_ERR(1, 645, __pyx_L1_error))
18147  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
18148 
18149  /* "View.MemoryView":647
18150  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18151  *
18152  * slice_copy(self, &src) # <<<<<<<<<<<<<<
18153  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
18154  * self.view.itemsize,
18155  */
18156  __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
18157  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
18158 
18159  /* "View.MemoryView":648
18160  *
18161  * slice_copy(self, &src)
18162  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
18163  * self.view.itemsize,
18164  * flags|PyBUF_F_CONTIGUOUS,
18165  */
18166  __Pyx_TraceLine(648,0,__PYX_ERR(1, 648, __pyx_L1_error))
18167  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
18168  __pyx_v_dst = __pyx_t_1;
18169 
18170  /* "View.MemoryView":653
18171  * self.dtype_is_object)
18172  *
18173  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
18174  *
18175  *
18176  */
18177  __Pyx_TraceLine(653,0,__PYX_ERR(1, 653, __pyx_L1_error))
18178  __Pyx_XDECREF(__pyx_r);
18179  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
18180  __Pyx_GOTREF(__pyx_t_2);
18181  __pyx_r = __pyx_t_2;
18182  __pyx_t_2 = 0;
18183  goto __pyx_L0;
18184 
18185  /* "View.MemoryView":643
18186  * return memoryview_copy_from_slice(self, &mslice)
18187  *
18188  * def copy_fortran(self): # <<<<<<<<<<<<<<
18189  * cdef __Pyx_memviewslice src, dst
18190  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18191  */
18192 
18193  /* function exit code */
18194  __pyx_L1_error:;
18195  __Pyx_XDECREF(__pyx_t_2);
18196  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
18197  __pyx_r = NULL;
18198  __pyx_L0:;
18199  __Pyx_XGIVEREF(__pyx_r);
18200  __Pyx_TraceReturn(__pyx_r, 0);
18201  __Pyx_RefNannyFinishContext();
18202  return __pyx_r;
18203 }
18204 
18205 /* "(tree fragment)":1
18206  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18207  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18208  * def __setstate_cython__(self, __pyx_state):
18209  */
18210 
18211 /* Python wrapper */
18212 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18213 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
18214 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18215  PyObject *__pyx_r = 0;
18216  __Pyx_RefNannyDeclarations
18217  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18218  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18219 
18220  /* function exit code */
18221  __Pyx_RefNannyFinishContext();
18222  return __pyx_r;
18223 }
18224 
18225 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
18226  PyObject *__pyx_r = NULL;
18227  __Pyx_TraceDeclarations
18228  __Pyx_RefNannyDeclarations
18229  PyObject *__pyx_t_1 = NULL;
18230  int __pyx_lineno = 0;
18231  const char *__pyx_filename = NULL;
18232  int __pyx_clineno = 0;
18233  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18234  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
18235 
18236  /* "(tree fragment)":2
18237  * def __reduce_cython__(self):
18238  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18239  * def __setstate_cython__(self, __pyx_state):
18240  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18241  */
18242  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
18243  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18244  __Pyx_GOTREF(__pyx_t_1);
18245  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18246  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18247  __PYX_ERR(1, 2, __pyx_L1_error)
18248 
18249  /* "(tree fragment)":1
18250  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18251  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18252  * def __setstate_cython__(self, __pyx_state):
18253  */
18254 
18255  /* function exit code */
18256  __pyx_L1_error:;
18257  __Pyx_XDECREF(__pyx_t_1);
18258  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18259  __pyx_r = NULL;
18260  __Pyx_XGIVEREF(__pyx_r);
18261  __Pyx_TraceReturn(__pyx_r, 0);
18262  __Pyx_RefNannyFinishContext();
18263  return __pyx_r;
18264 }
18265 
18266 /* "(tree fragment)":3
18267  * def __reduce_cython__(self):
18268  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18269  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18270  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18271  */
18272 
18273 /* Python wrapper */
18274 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18275 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
18276 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18277  PyObject *__pyx_r = 0;
18278  __Pyx_RefNannyDeclarations
18279  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18280  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18281 
18282  /* function exit code */
18283  __Pyx_RefNannyFinishContext();
18284  return __pyx_r;
18285 }
18286 
18287 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18288  PyObject *__pyx_r = NULL;
18289  __Pyx_TraceDeclarations
18290  __Pyx_RefNannyDeclarations
18291  PyObject *__pyx_t_1 = NULL;
18292  int __pyx_lineno = 0;
18293  const char *__pyx_filename = NULL;
18294  int __pyx_clineno = 0;
18295  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18296  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
18297 
18298  /* "(tree fragment)":4
18299  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18300  * def __setstate_cython__(self, __pyx_state):
18301  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18302  */
18303  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
18304  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18305  __Pyx_GOTREF(__pyx_t_1);
18306  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18307  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18308  __PYX_ERR(1, 4, __pyx_L1_error)
18309 
18310  /* "(tree fragment)":3
18311  * def __reduce_cython__(self):
18312  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18313  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18314  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18315  */
18316 
18317  /* function exit code */
18318  __pyx_L1_error:;
18319  __Pyx_XDECREF(__pyx_t_1);
18320  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18321  __pyx_r = NULL;
18322  __Pyx_XGIVEREF(__pyx_r);
18323  __Pyx_TraceReturn(__pyx_r, 0);
18324  __Pyx_RefNannyFinishContext();
18325  return __pyx_r;
18326 }
18327 
18328 /* "View.MemoryView":657
18329  *
18330  * @cname('__pyx_memoryview_new')
18331  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
18332  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18333  * result.typeinfo = typeinfo
18334  */
18335 
18336 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
18337  struct __pyx_memoryview_obj *__pyx_v_result = 0;
18338  PyObject *__pyx_r = NULL;
18339  __Pyx_TraceDeclarations
18340  __Pyx_RefNannyDeclarations
18341  PyObject *__pyx_t_1 = NULL;
18342  PyObject *__pyx_t_2 = NULL;
18343  PyObject *__pyx_t_3 = NULL;
18344  int __pyx_lineno = 0;
18345  const char *__pyx_filename = NULL;
18346  int __pyx_clineno = 0;
18347  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
18348  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
18349 
18350  /* "View.MemoryView":658
18351  * @cname('__pyx_memoryview_new')
18352  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
18353  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
18354  * result.typeinfo = typeinfo
18355  * return result
18356  */
18357  __Pyx_TraceLine(658,0,__PYX_ERR(1, 658, __pyx_L1_error))
18358  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
18359  __Pyx_GOTREF(__pyx_t_1);
18360  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
18361  __Pyx_GOTREF(__pyx_t_2);
18362  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
18363  __Pyx_GOTREF(__pyx_t_3);
18364  __Pyx_INCREF(__pyx_v_o);
18365  __Pyx_GIVEREF(__pyx_v_o);
18366  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
18367  __Pyx_GIVEREF(__pyx_t_1);
18368  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
18369  __Pyx_GIVEREF(__pyx_t_2);
18370  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18371  __pyx_t_1 = 0;
18372  __pyx_t_2 = 0;
18373  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
18374  __Pyx_GOTREF(__pyx_t_2);
18375  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18376  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
18377  __pyx_t_2 = 0;
18378 
18379  /* "View.MemoryView":659
18380  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
18381  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18382  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
18383  * return result
18384  *
18385  */
18386  __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
18387  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
18388 
18389  /* "View.MemoryView":660
18390  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18391  * result.typeinfo = typeinfo
18392  * return result # <<<<<<<<<<<<<<
18393  *
18394  * @cname('__pyx_memoryview_check')
18395  */
18396  __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
18397  __Pyx_XDECREF(__pyx_r);
18398  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18399  __pyx_r = ((PyObject *)__pyx_v_result);
18400  goto __pyx_L0;
18401 
18402  /* "View.MemoryView":657
18403  *
18404  * @cname('__pyx_memoryview_new')
18405  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
18406  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
18407  * result.typeinfo = typeinfo
18408  */
18409 
18410  /* function exit code */
18411  __pyx_L1_error:;
18412  __Pyx_XDECREF(__pyx_t_1);
18413  __Pyx_XDECREF(__pyx_t_2);
18414  __Pyx_XDECREF(__pyx_t_3);
18415  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
18416  __pyx_r = 0;
18417  __pyx_L0:;
18418  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18419  __Pyx_XGIVEREF(__pyx_r);
18420  __Pyx_TraceReturn(__pyx_r, 0);
18421  __Pyx_RefNannyFinishContext();
18422  return __pyx_r;
18423 }
18424 
18425 /* "View.MemoryView":663
18426  *
18427  * @cname('__pyx_memoryview_check')
18428  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
18429  * return isinstance(o, memoryview)
18430  *
18431  */
18432 
18433 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
18434  int __pyx_r;
18435  __Pyx_TraceDeclarations
18436  __Pyx_RefNannyDeclarations
18437  int __pyx_t_1;
18438  int __pyx_lineno = 0;
18439  const char *__pyx_filename = NULL;
18440  int __pyx_clineno = 0;
18441  __Pyx_RefNannySetupContext("memoryview_check", 0);
18442  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
18443 
18444  /* "View.MemoryView":664
18445  * @cname('__pyx_memoryview_check')
18446  * cdef inline bint memoryview_check(object o):
18447  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
18448  *
18449  * cdef tuple _unellipsify(object index, int ndim):
18450  */
18451  __Pyx_TraceLine(664,0,__PYX_ERR(1, 664, __pyx_L1_error))
18452  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
18453  __pyx_r = __pyx_t_1;
18454  goto __pyx_L0;
18455 
18456  /* "View.MemoryView":663
18457  *
18458  * @cname('__pyx_memoryview_check')
18459  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
18460  * return isinstance(o, memoryview)
18461  *
18462  */
18463 
18464  /* function exit code */
18465  __pyx_L1_error:;
18466  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18467  __pyx_r = 0;
18468  __pyx_L0:;
18469  __Pyx_TraceReturn(Py_None, 0);
18470  __Pyx_RefNannyFinishContext();
18471  return __pyx_r;
18472 }
18473 
18474 /* "View.MemoryView":666
18475  * return isinstance(o, memoryview)
18476  *
18477  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
18478  * """
18479  * Replace all ellipses with full slices and fill incomplete indices with
18480  */
18481 
18482 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
18483  PyObject *__pyx_v_tup = NULL;
18484  PyObject *__pyx_v_result = NULL;
18485  int __pyx_v_have_slices;
18486  int __pyx_v_seen_ellipsis;
18487  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
18488  PyObject *__pyx_v_item = NULL;
18489  Py_ssize_t __pyx_v_nslices;
18490  PyObject *__pyx_r = NULL;
18491  __Pyx_TraceDeclarations
18492  __Pyx_RefNannyDeclarations
18493  int __pyx_t_1;
18494  int __pyx_t_2;
18495  PyObject *__pyx_t_3 = NULL;
18496  PyObject *__pyx_t_4 = NULL;
18497  Py_ssize_t __pyx_t_5;
18498  PyObject *(*__pyx_t_6)(PyObject *);
18499  PyObject *__pyx_t_7 = NULL;
18500  Py_ssize_t __pyx_t_8;
18501  int __pyx_t_9;
18502  int __pyx_t_10;
18503  PyObject *__pyx_t_11 = NULL;
18504  int __pyx_lineno = 0;
18505  const char *__pyx_filename = NULL;
18506  int __pyx_clineno = 0;
18507  __Pyx_RefNannySetupContext("_unellipsify", 0);
18508  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
18509 
18510  /* "View.MemoryView":671
18511  * full slices.
18512  * """
18513  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
18514  * tup = (index,)
18515  * else:
18516  */
18517  __Pyx_TraceLine(671,0,__PYX_ERR(1, 671, __pyx_L1_error))
18518  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
18519  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
18520  if (__pyx_t_2) {
18521 
18522  /* "View.MemoryView":672
18523  * """
18524  * if not isinstance(index, tuple):
18525  * tup = (index,) # <<<<<<<<<<<<<<
18526  * else:
18527  * tup = index
18528  */
18529  __Pyx_TraceLine(672,0,__PYX_ERR(1, 672, __pyx_L1_error))
18530  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
18531  __Pyx_GOTREF(__pyx_t_3);
18532  __Pyx_INCREF(__pyx_v_index);
18533  __Pyx_GIVEREF(__pyx_v_index);
18534  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
18535  __pyx_v_tup = __pyx_t_3;
18536  __pyx_t_3 = 0;
18537 
18538  /* "View.MemoryView":671
18539  * full slices.
18540  * """
18541  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
18542  * tup = (index,)
18543  * else:
18544  */
18545  goto __pyx_L3;
18546  }
18547 
18548  /* "View.MemoryView":674
18549  * tup = (index,)
18550  * else:
18551  * tup = index # <<<<<<<<<<<<<<
18552  *
18553  * result = []
18554  */
18555  __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
18556  /*else*/ {
18557  __Pyx_INCREF(__pyx_v_index);
18558  __pyx_v_tup = __pyx_v_index;
18559  }
18560  __pyx_L3:;
18561 
18562  /* "View.MemoryView":676
18563  * tup = index
18564  *
18565  * result = [] # <<<<<<<<<<<<<<
18566  * have_slices = False
18567  * seen_ellipsis = False
18568  */
18569  __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
18570  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
18571  __Pyx_GOTREF(__pyx_t_3);
18572  __pyx_v_result = ((PyObject*)__pyx_t_3);
18573  __pyx_t_3 = 0;
18574 
18575  /* "View.MemoryView":677
18576  *
18577  * result = []
18578  * have_slices = False # <<<<<<<<<<<<<<
18579  * seen_ellipsis = False
18580  * for idx, item in enumerate(tup):
18581  */
18582  __Pyx_TraceLine(677,0,__PYX_ERR(1, 677, __pyx_L1_error))
18583  __pyx_v_have_slices = 0;
18584 
18585  /* "View.MemoryView":678
18586  * result = []
18587  * have_slices = False
18588  * seen_ellipsis = False # <<<<<<<<<<<<<<
18589  * for idx, item in enumerate(tup):
18590  * if item is Ellipsis:
18591  */
18592  __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
18593  __pyx_v_seen_ellipsis = 0;
18594 
18595  /* "View.MemoryView":679
18596  * have_slices = False
18597  * seen_ellipsis = False
18598  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
18599  * if item is Ellipsis:
18600  * if not seen_ellipsis:
18601  */
18602  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
18603  __Pyx_INCREF(__pyx_int_0);
18604  __pyx_t_3 = __pyx_int_0;
18605  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
18606  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
18607  __pyx_t_6 = NULL;
18608  } else {
18609  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
18610  __Pyx_GOTREF(__pyx_t_4);
18611  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
18612  }
18613  for (;;) {
18614  if (likely(!__pyx_t_6)) {
18615  if (likely(PyList_CheckExact(__pyx_t_4))) {
18616  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
18617  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18618  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
18619  #else
18620  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18621  __Pyx_GOTREF(__pyx_t_7);
18622  #endif
18623  } else {
18624  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
18625  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18626  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
18627  #else
18628  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18629  __Pyx_GOTREF(__pyx_t_7);
18630  #endif
18631  }
18632  } else {
18633  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
18634  if (unlikely(!__pyx_t_7)) {
18635  PyObject* exc_type = PyErr_Occurred();
18636  if (exc_type) {
18637  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18638  else __PYX_ERR(1, 679, __pyx_L1_error)
18639  }
18640  break;
18641  }
18642  __Pyx_GOTREF(__pyx_t_7);
18643  }
18644  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
18645  __pyx_t_7 = 0;
18646  __Pyx_INCREF(__pyx_t_3);
18647  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
18648  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18649  __Pyx_GOTREF(__pyx_t_7);
18650  __Pyx_DECREF(__pyx_t_3);
18651  __pyx_t_3 = __pyx_t_7;
18652  __pyx_t_7 = 0;
18653 
18654  /* "View.MemoryView":680
18655  * seen_ellipsis = False
18656  * for idx, item in enumerate(tup):
18657  * if item is Ellipsis: # <<<<<<<<<<<<<<
18658  * if not seen_ellipsis:
18659  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18660  */
18661  __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
18662  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
18663  __pyx_t_1 = (__pyx_t_2 != 0);
18664  if (__pyx_t_1) {
18665 
18666  /* "View.MemoryView":681
18667  * for idx, item in enumerate(tup):
18668  * if item is Ellipsis:
18669  * if not seen_ellipsis: # <<<<<<<<<<<<<<
18670  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18671  * seen_ellipsis = True
18672  */
18673  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
18674  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
18675  if (__pyx_t_1) {
18676 
18677  /* "View.MemoryView":682
18678  * if item is Ellipsis:
18679  * if not seen_ellipsis:
18680  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
18681  * seen_ellipsis = True
18682  * else:
18683  */
18684  __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
18685  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
18686  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
18687  __Pyx_GOTREF(__pyx_t_7);
18688  { Py_ssize_t __pyx_temp;
18689  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
18690  __Pyx_INCREF(__pyx_slice__36);
18691  __Pyx_GIVEREF(__pyx_slice__36);
18692  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__36);
18693  }
18694  }
18695  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
18696  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18697 
18698  /* "View.MemoryView":683
18699  * if not seen_ellipsis:
18700  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18701  * seen_ellipsis = True # <<<<<<<<<<<<<<
18702  * else:
18703  * result.append(slice(None))
18704  */
18705  __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
18706  __pyx_v_seen_ellipsis = 1;
18707 
18708  /* "View.MemoryView":681
18709  * for idx, item in enumerate(tup):
18710  * if item is Ellipsis:
18711  * if not seen_ellipsis: # <<<<<<<<<<<<<<
18712  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18713  * seen_ellipsis = True
18714  */
18715  goto __pyx_L7;
18716  }
18717 
18718  /* "View.MemoryView":685
18719  * seen_ellipsis = True
18720  * else:
18721  * result.append(slice(None)) # <<<<<<<<<<<<<<
18722  * have_slices = True
18723  * else:
18724  */
18725  __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
18726  /*else*/ {
18727  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__36); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
18728  }
18729  __pyx_L7:;
18730 
18731  /* "View.MemoryView":686
18732  * else:
18733  * result.append(slice(None))
18734  * have_slices = True # <<<<<<<<<<<<<<
18735  * else:
18736  * if not isinstance(item, slice) and not PyIndex_Check(item):
18737  */
18738  __Pyx_TraceLine(686,0,__PYX_ERR(1, 686, __pyx_L1_error))
18739  __pyx_v_have_slices = 1;
18740 
18741  /* "View.MemoryView":680
18742  * seen_ellipsis = False
18743  * for idx, item in enumerate(tup):
18744  * if item is Ellipsis: # <<<<<<<<<<<<<<
18745  * if not seen_ellipsis:
18746  * result.extend([slice(None)] * (ndim - len(tup) + 1))
18747  */
18748  goto __pyx_L6;
18749  }
18750 
18751  /* "View.MemoryView":688
18752  * have_slices = True
18753  * else:
18754  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
18755  * raise TypeError("Cannot index with type '%s'" % type(item))
18756  *
18757  */
18758  __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
18759  /*else*/ {
18760  __pyx_t_2 = PySlice_Check(__pyx_v_item);
18761  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
18762  if (__pyx_t_10) {
18763  } else {
18764  __pyx_t_1 = __pyx_t_10;
18765  goto __pyx_L9_bool_binop_done;
18766  }
18767  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
18768  __pyx_t_1 = __pyx_t_10;
18769  __pyx_L9_bool_binop_done:;
18770  if (unlikely(__pyx_t_1)) {
18771 
18772  /* "View.MemoryView":689
18773  * else:
18774  * if not isinstance(item, slice) and not PyIndex_Check(item):
18775  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
18776  *
18777  * have_slices = have_slices or isinstance(item, slice)
18778  */
18779  __Pyx_TraceLine(689,0,__PYX_ERR(1, 689, __pyx_L1_error))
18780  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
18781  __Pyx_GOTREF(__pyx_t_7);
18782  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
18783  __Pyx_GOTREF(__pyx_t_11);
18784  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18785  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
18786  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
18787  __PYX_ERR(1, 689, __pyx_L1_error)
18788 
18789  /* "View.MemoryView":688
18790  * have_slices = True
18791  * else:
18792  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
18793  * raise TypeError("Cannot index with type '%s'" % type(item))
18794  *
18795  */
18796  }
18797 
18798  /* "View.MemoryView":691
18799  * raise TypeError("Cannot index with type '%s'" % type(item))
18800  *
18801  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
18802  * result.append(item)
18803  *
18804  */
18805  __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
18806  __pyx_t_10 = (__pyx_v_have_slices != 0);
18807  if (!__pyx_t_10) {
18808  } else {
18809  __pyx_t_1 = __pyx_t_10;
18810  goto __pyx_L11_bool_binop_done;
18811  }
18812  __pyx_t_10 = PySlice_Check(__pyx_v_item);
18813  __pyx_t_2 = (__pyx_t_10 != 0);
18814  __pyx_t_1 = __pyx_t_2;
18815  __pyx_L11_bool_binop_done:;
18816  __pyx_v_have_slices = __pyx_t_1;
18817 
18818  /* "View.MemoryView":692
18819  *
18820  * have_slices = have_slices or isinstance(item, slice)
18821  * result.append(item) # <<<<<<<<<<<<<<
18822  *
18823  * nslices = ndim - len(result)
18824  */
18825  __Pyx_TraceLine(692,0,__PYX_ERR(1, 692, __pyx_L1_error))
18826  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
18827  }
18828  __pyx_L6:;
18829 
18830  /* "View.MemoryView":679
18831  * have_slices = False
18832  * seen_ellipsis = False
18833  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
18834  * if item is Ellipsis:
18835  * if not seen_ellipsis:
18836  */
18837  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
18838  }
18839  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18840  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18841 
18842  /* "View.MemoryView":694
18843  * result.append(item)
18844  *
18845  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
18846  * if nslices:
18847  * result.extend([slice(None)] * nslices)
18848  */
18849  __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
18850  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
18851  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
18852 
18853  /* "View.MemoryView":695
18854  *
18855  * nslices = ndim - len(result)
18856  * if nslices: # <<<<<<<<<<<<<<
18857  * result.extend([slice(None)] * nslices)
18858  *
18859  */
18860  __Pyx_TraceLine(695,0,__PYX_ERR(1, 695, __pyx_L1_error))
18861  __pyx_t_1 = (__pyx_v_nslices != 0);
18862  if (__pyx_t_1) {
18863 
18864  /* "View.MemoryView":696
18865  * nslices = ndim - len(result)
18866  * if nslices:
18867  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
18868  *
18869  * return have_slices or nslices, tuple(result)
18870  */
18871  __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
18872  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
18873  __Pyx_GOTREF(__pyx_t_3);
18874  { Py_ssize_t __pyx_temp;
18875  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
18876  __Pyx_INCREF(__pyx_slice__36);
18877  __Pyx_GIVEREF(__pyx_slice__36);
18878  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__36);
18879  }
18880  }
18881  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
18882  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18883 
18884  /* "View.MemoryView":695
18885  *
18886  * nslices = ndim - len(result)
18887  * if nslices: # <<<<<<<<<<<<<<
18888  * result.extend([slice(None)] * nslices)
18889  *
18890  */
18891  }
18892 
18893  /* "View.MemoryView":698
18894  * result.extend([slice(None)] * nslices)
18895  *
18896  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
18897  *
18898  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
18899  */
18900  __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
18901  __Pyx_XDECREF(__pyx_r);
18902  if (!__pyx_v_have_slices) {
18903  } else {
18904  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18905  __Pyx_GOTREF(__pyx_t_4);
18906  __pyx_t_3 = __pyx_t_4;
18907  __pyx_t_4 = 0;
18908  goto __pyx_L14_bool_binop_done;
18909  }
18910  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18911  __Pyx_GOTREF(__pyx_t_4);
18912  __pyx_t_3 = __pyx_t_4;
18913  __pyx_t_4 = 0;
18914  __pyx_L14_bool_binop_done:;
18915  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18916  __Pyx_GOTREF(__pyx_t_4);
18917  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
18918  __Pyx_GOTREF(__pyx_t_11);
18919  __Pyx_GIVEREF(__pyx_t_3);
18920  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
18921  __Pyx_GIVEREF(__pyx_t_4);
18922  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
18923  __pyx_t_3 = 0;
18924  __pyx_t_4 = 0;
18925  __pyx_r = ((PyObject*)__pyx_t_11);
18926  __pyx_t_11 = 0;
18927  goto __pyx_L0;
18928 
18929  /* "View.MemoryView":666
18930  * return isinstance(o, memoryview)
18931  *
18932  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
18933  * """
18934  * Replace all ellipses with full slices and fill incomplete indices with
18935  */
18936 
18937  /* function exit code */
18938  __pyx_L1_error:;
18939  __Pyx_XDECREF(__pyx_t_3);
18940  __Pyx_XDECREF(__pyx_t_4);
18941  __Pyx_XDECREF(__pyx_t_7);
18942  __Pyx_XDECREF(__pyx_t_11);
18943  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
18944  __pyx_r = 0;
18945  __pyx_L0:;
18946  __Pyx_XDECREF(__pyx_v_tup);
18947  __Pyx_XDECREF(__pyx_v_result);
18948  __Pyx_XDECREF(__pyx_v_idx);
18949  __Pyx_XDECREF(__pyx_v_item);
18950  __Pyx_XGIVEREF(__pyx_r);
18951  __Pyx_TraceReturn(__pyx_r, 0);
18952  __Pyx_RefNannyFinishContext();
18953  return __pyx_r;
18954 }
18955 
18956 /* "View.MemoryView":700
18957  * return have_slices or nslices, tuple(result)
18958  *
18959  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
18960  * for suboffset in suboffsets[:ndim]:
18961  * if suboffset >= 0:
18962  */
18963 
18964 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
18965  Py_ssize_t __pyx_v_suboffset;
18966  PyObject *__pyx_r = NULL;
18967  __Pyx_TraceDeclarations
18968  __Pyx_RefNannyDeclarations
18969  Py_ssize_t *__pyx_t_1;
18970  Py_ssize_t *__pyx_t_2;
18971  Py_ssize_t *__pyx_t_3;
18972  int __pyx_t_4;
18973  PyObject *__pyx_t_5 = NULL;
18974  int __pyx_lineno = 0;
18975  const char *__pyx_filename = NULL;
18976  int __pyx_clineno = 0;
18977  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
18978  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
18979 
18980  /* "View.MemoryView":701
18981  *
18982  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
18983  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
18984  * if suboffset >= 0:
18985  * raise ValueError("Indirect dimensions not supported")
18986  */
18987  __Pyx_TraceLine(701,0,__PYX_ERR(1, 701, __pyx_L1_error))
18988  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
18989  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
18990  __pyx_t_1 = __pyx_t_3;
18991  __pyx_v_suboffset = (__pyx_t_1[0]);
18992 
18993  /* "View.MemoryView":702
18994  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
18995  * for suboffset in suboffsets[:ndim]:
18996  * if suboffset >= 0: # <<<<<<<<<<<<<<
18997  * raise ValueError("Indirect dimensions not supported")
18998  *
18999  */
19000  __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
19001  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
19002  if (unlikely(__pyx_t_4)) {
19003 
19004  /* "View.MemoryView":703
19005  * for suboffset in suboffsets[:ndim]:
19006  * if suboffset >= 0:
19007  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
19008  *
19009  *
19010  */
19011  __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
19012  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
19013  __Pyx_GOTREF(__pyx_t_5);
19014  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
19015  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19016  __PYX_ERR(1, 703, __pyx_L1_error)
19017 
19018  /* "View.MemoryView":702
19019  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19020  * for suboffset in suboffsets[:ndim]:
19021  * if suboffset >= 0: # <<<<<<<<<<<<<<
19022  * raise ValueError("Indirect dimensions not supported")
19023  *
19024  */
19025  }
19026  }
19027 
19028  /* "View.MemoryView":700
19029  * return have_slices or nslices, tuple(result)
19030  *
19031  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
19032  * for suboffset in suboffsets[:ndim]:
19033  * if suboffset >= 0:
19034  */
19035 
19036  /* function exit code */
19037  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19038  goto __pyx_L0;
19039  __pyx_L1_error:;
19040  __Pyx_XDECREF(__pyx_t_5);
19041  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
19042  __pyx_r = 0;
19043  __pyx_L0:;
19044  __Pyx_XGIVEREF(__pyx_r);
19045  __Pyx_TraceReturn(__pyx_r, 0);
19046  __Pyx_RefNannyFinishContext();
19047  return __pyx_r;
19048 }
19049 
19050 /* "View.MemoryView":710
19051  *
19052  * @cname('__pyx_memview_slice')
19053  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
19054  * cdef int new_ndim = 0, suboffset_dim = -1, dim
19055  * cdef bint negative_step
19056  */
19057 
19058 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
19059  int __pyx_v_new_ndim;
19060  int __pyx_v_suboffset_dim;
19061  int __pyx_v_dim;
19062  __Pyx_memviewslice __pyx_v_src;
19063  __Pyx_memviewslice __pyx_v_dst;
19064  __Pyx_memviewslice *__pyx_v_p_src;
19065  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
19066  __Pyx_memviewslice *__pyx_v_p_dst;
19067  int *__pyx_v_p_suboffset_dim;
19068  Py_ssize_t __pyx_v_start;
19069  Py_ssize_t __pyx_v_stop;
19070  Py_ssize_t __pyx_v_step;
19071  int __pyx_v_have_start;
19072  int __pyx_v_have_stop;
19073  int __pyx_v_have_step;
19074  PyObject *__pyx_v_index = NULL;
19075  struct __pyx_memoryview_obj *__pyx_r = NULL;
19076  __Pyx_TraceDeclarations
19077  __Pyx_RefNannyDeclarations
19078  int __pyx_t_1;
19079  int __pyx_t_2;
19080  PyObject *__pyx_t_3 = NULL;
19081  struct __pyx_memoryview_obj *__pyx_t_4;
19082  char *__pyx_t_5;
19083  int __pyx_t_6;
19084  Py_ssize_t __pyx_t_7;
19085  PyObject *(*__pyx_t_8)(PyObject *);
19086  PyObject *__pyx_t_9 = NULL;
19087  Py_ssize_t __pyx_t_10;
19088  int __pyx_t_11;
19089  Py_ssize_t __pyx_t_12;
19090  int __pyx_lineno = 0;
19091  const char *__pyx_filename = NULL;
19092  int __pyx_clineno = 0;
19093  __Pyx_RefNannySetupContext("memview_slice", 0);
19094  __Pyx_TraceCall("memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
19095 
19096  /* "View.MemoryView":711
19097  * @cname('__pyx_memview_slice')
19098  * cdef memoryview memview_slice(memoryview memview, object indices):
19099  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
19100  * cdef bint negative_step
19101  * cdef __Pyx_memviewslice src, dst
19102  */
19103  __Pyx_TraceLine(711,0,__PYX_ERR(1, 711, __pyx_L1_error))
19104  __pyx_v_new_ndim = 0;
19105  __pyx_v_suboffset_dim = -1;
19106 
19107  /* "View.MemoryView":718
19108  *
19109  *
19110  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
19111  *
19112  * cdef _memoryviewslice memviewsliceobj
19113  */
19114  __Pyx_TraceLine(718,0,__PYX_ERR(1, 718, __pyx_L1_error))
19115  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
19116 
19117  /* "View.MemoryView":722
19118  * cdef _memoryviewslice memviewsliceobj
19119  *
19120  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
19121  *
19122  * if isinstance(memview, _memoryviewslice):
19123  */
19124  __Pyx_TraceLine(722,0,__PYX_ERR(1, 722, __pyx_L1_error))
19125  #ifndef CYTHON_WITHOUT_ASSERTIONS
19126  if (unlikely(!Py_OptimizeFlag)) {
19127  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
19128  PyErr_SetNone(PyExc_AssertionError);
19129  __PYX_ERR(1, 722, __pyx_L1_error)
19130  }
19131  }
19132  #endif
19133 
19134  /* "View.MemoryView":724
19135  * assert memview.view.ndim > 0
19136  *
19137  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19138  * memviewsliceobj = memview
19139  * p_src = &memviewsliceobj.from_slice
19140  */
19141  __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
19142  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19143  __pyx_t_2 = (__pyx_t_1 != 0);
19144  if (__pyx_t_2) {
19145 
19146  /* "View.MemoryView":725
19147  *
19148  * if isinstance(memview, _memoryviewslice):
19149  * memviewsliceobj = memview # <<<<<<<<<<<<<<
19150  * p_src = &memviewsliceobj.from_slice
19151  * else:
19152  */
19153  __Pyx_TraceLine(725,0,__PYX_ERR(1, 725, __pyx_L1_error))
19154  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
19155  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
19156  __Pyx_INCREF(__pyx_t_3);
19157  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
19158  __pyx_t_3 = 0;
19159 
19160  /* "View.MemoryView":726
19161  * if isinstance(memview, _memoryviewslice):
19162  * memviewsliceobj = memview
19163  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
19164  * else:
19165  * slice_copy(memview, &src)
19166  */
19167  __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
19168  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
19169 
19170  /* "View.MemoryView":724
19171  * assert memview.view.ndim > 0
19172  *
19173  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19174  * memviewsliceobj = memview
19175  * p_src = &memviewsliceobj.from_slice
19176  */
19177  goto __pyx_L3;
19178  }
19179 
19180  /* "View.MemoryView":728
19181  * p_src = &memviewsliceobj.from_slice
19182  * else:
19183  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
19184  * p_src = &src
19185  *
19186  */
19187  __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
19188  /*else*/ {
19189  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
19190 
19191  /* "View.MemoryView":729
19192  * else:
19193  * slice_copy(memview, &src)
19194  * p_src = &src # <<<<<<<<<<<<<<
19195  *
19196  *
19197  */
19198  __Pyx_TraceLine(729,0,__PYX_ERR(1, 729, __pyx_L1_error))
19199  __pyx_v_p_src = (&__pyx_v_src);
19200  }
19201  __pyx_L3:;
19202 
19203  /* "View.MemoryView":735
19204  *
19205  *
19206  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
19207  * dst.data = p_src.data
19208  *
19209  */
19210  __Pyx_TraceLine(735,0,__PYX_ERR(1, 735, __pyx_L1_error))
19211  __pyx_t_4 = __pyx_v_p_src->memview;
19212  __pyx_v_dst.memview = __pyx_t_4;
19213 
19214  /* "View.MemoryView":736
19215  *
19216  * dst.memview = p_src.memview
19217  * dst.data = p_src.data # <<<<<<<<<<<<<<
19218  *
19219  *
19220  */
19221  __Pyx_TraceLine(736,0,__PYX_ERR(1, 736, __pyx_L1_error))
19222  __pyx_t_5 = __pyx_v_p_src->data;
19223  __pyx_v_dst.data = __pyx_t_5;
19224 
19225  /* "View.MemoryView":741
19226  *
19227  *
19228  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
19229  * cdef int *p_suboffset_dim = &suboffset_dim
19230  * cdef Py_ssize_t start, stop, step
19231  */
19232  __Pyx_TraceLine(741,0,__PYX_ERR(1, 741, __pyx_L1_error))
19233  __pyx_v_p_dst = (&__pyx_v_dst);
19234 
19235  /* "View.MemoryView":742
19236  *
19237  * cdef __Pyx_memviewslice *p_dst = &dst
19238  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
19239  * cdef Py_ssize_t start, stop, step
19240  * cdef bint have_start, have_stop, have_step
19241  */
19242  __Pyx_TraceLine(742,0,__PYX_ERR(1, 742, __pyx_L1_error))
19243  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
19244 
19245  /* "View.MemoryView":746
19246  * cdef bint have_start, have_stop, have_step
19247  *
19248  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
19249  * if PyIndex_Check(index):
19250  * slice_memviewslice(
19251  */
19252  __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
19253  __pyx_t_6 = 0;
19254  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
19255  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
19256  __pyx_t_8 = NULL;
19257  } else {
19258  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
19259  __Pyx_GOTREF(__pyx_t_3);
19260  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
19261  }
19262  for (;;) {
19263  if (likely(!__pyx_t_8)) {
19264  if (likely(PyList_CheckExact(__pyx_t_3))) {
19265  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
19266  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19267  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
19268  #else
19269  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
19270  __Pyx_GOTREF(__pyx_t_9);
19271  #endif
19272  } else {
19273  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
19274  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19275  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
19276  #else
19277  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
19278  __Pyx_GOTREF(__pyx_t_9);
19279  #endif
19280  }
19281  } else {
19282  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
19283  if (unlikely(!__pyx_t_9)) {
19284  PyObject* exc_type = PyErr_Occurred();
19285  if (exc_type) {
19286  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19287  else __PYX_ERR(1, 746, __pyx_L1_error)
19288  }
19289  break;
19290  }
19291  __Pyx_GOTREF(__pyx_t_9);
19292  }
19293  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
19294  __pyx_t_9 = 0;
19295  __pyx_v_dim = __pyx_t_6;
19296  __pyx_t_6 = (__pyx_t_6 + 1);
19297 
19298  /* "View.MemoryView":747
19299  *
19300  * for dim, index in enumerate(indices):
19301  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
19302  * slice_memviewslice(
19303  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19304  */
19305  __Pyx_TraceLine(747,0,__PYX_ERR(1, 747, __pyx_L1_error))
19306  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
19307  if (__pyx_t_2) {
19308 
19309  /* "View.MemoryView":751
19310  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19311  * dim, new_ndim, p_suboffset_dim,
19312  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
19313  * 0, 0, 0, # have_{start,stop,step}
19314  * False)
19315  */
19316  __Pyx_TraceLine(751,0,__PYX_ERR(1, 751, __pyx_L1_error))
19317  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
19318 
19319  /* "View.MemoryView":748
19320  * for dim, index in enumerate(indices):
19321  * if PyIndex_Check(index):
19322  * slice_memviewslice( # <<<<<<<<<<<<<<
19323  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19324  * dim, new_ndim, p_suboffset_dim,
19325  */
19326  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
19327  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
19328 
19329  /* "View.MemoryView":747
19330  *
19331  * for dim, index in enumerate(indices):
19332  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
19333  * slice_memviewslice(
19334  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19335  */
19336  goto __pyx_L6;
19337  }
19338 
19339  /* "View.MemoryView":754
19340  * 0, 0, 0, # have_{start,stop,step}
19341  * False)
19342  * elif index is None: # <<<<<<<<<<<<<<
19343  * p_dst.shape[new_ndim] = 1
19344  * p_dst.strides[new_ndim] = 0
19345  */
19346  __Pyx_TraceLine(754,0,__PYX_ERR(1, 754, __pyx_L1_error))
19347  __pyx_t_2 = (__pyx_v_index == Py_None);
19348  __pyx_t_1 = (__pyx_t_2 != 0);
19349  if (__pyx_t_1) {
19350 
19351  /* "View.MemoryView":755
19352  * False)
19353  * elif index is None:
19354  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
19355  * p_dst.strides[new_ndim] = 0
19356  * p_dst.suboffsets[new_ndim] = -1
19357  */
19358  __Pyx_TraceLine(755,0,__PYX_ERR(1, 755, __pyx_L1_error))
19359  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
19360 
19361  /* "View.MemoryView":756
19362  * elif index is None:
19363  * p_dst.shape[new_ndim] = 1
19364  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
19365  * p_dst.suboffsets[new_ndim] = -1
19366  * new_ndim += 1
19367  */
19368  __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
19369  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
19370 
19371  /* "View.MemoryView":757
19372  * p_dst.shape[new_ndim] = 1
19373  * p_dst.strides[new_ndim] = 0
19374  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
19375  * new_ndim += 1
19376  * else:
19377  */
19378  __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
19379  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
19380 
19381  /* "View.MemoryView":758
19382  * p_dst.strides[new_ndim] = 0
19383  * p_dst.suboffsets[new_ndim] = -1
19384  * new_ndim += 1 # <<<<<<<<<<<<<<
19385  * else:
19386  * start = index.start or 0
19387  */
19388  __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
19389  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19390 
19391  /* "View.MemoryView":754
19392  * 0, 0, 0, # have_{start,stop,step}
19393  * False)
19394  * elif index is None: # <<<<<<<<<<<<<<
19395  * p_dst.shape[new_ndim] = 1
19396  * p_dst.strides[new_ndim] = 0
19397  */
19398  goto __pyx_L6;
19399  }
19400 
19401  /* "View.MemoryView":760
19402  * new_ndim += 1
19403  * else:
19404  * start = index.start or 0 # <<<<<<<<<<<<<<
19405  * stop = index.stop or 0
19406  * step = index.step or 0
19407  */
19408  __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
19409  /*else*/ {
19410  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
19411  __Pyx_GOTREF(__pyx_t_9);
19412  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
19413  if (!__pyx_t_1) {
19414  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19415  } else {
19416  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
19417  __pyx_t_10 = __pyx_t_12;
19418  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19419  goto __pyx_L7_bool_binop_done;
19420  }
19421  __pyx_t_10 = 0;
19422  __pyx_L7_bool_binop_done:;
19423  __pyx_v_start = __pyx_t_10;
19424 
19425  /* "View.MemoryView":761
19426  * else:
19427  * start = index.start or 0
19428  * stop = index.stop or 0 # <<<<<<<<<<<<<<
19429  * step = index.step or 0
19430  *
19431  */
19432  __Pyx_TraceLine(761,0,__PYX_ERR(1, 761, __pyx_L1_error))
19433  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
19434  __Pyx_GOTREF(__pyx_t_9);
19435  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
19436  if (!__pyx_t_1) {
19437  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19438  } else {
19439  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
19440  __pyx_t_10 = __pyx_t_12;
19441  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19442  goto __pyx_L9_bool_binop_done;
19443  }
19444  __pyx_t_10 = 0;
19445  __pyx_L9_bool_binop_done:;
19446  __pyx_v_stop = __pyx_t_10;
19447 
19448  /* "View.MemoryView":762
19449  * start = index.start or 0
19450  * stop = index.stop or 0
19451  * step = index.step or 0 # <<<<<<<<<<<<<<
19452  *
19453  * have_start = index.start is not None
19454  */
19455  __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
19456  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
19457  __Pyx_GOTREF(__pyx_t_9);
19458  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
19459  if (!__pyx_t_1) {
19460  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19461  } else {
19462  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
19463  __pyx_t_10 = __pyx_t_12;
19464  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19465  goto __pyx_L11_bool_binop_done;
19466  }
19467  __pyx_t_10 = 0;
19468  __pyx_L11_bool_binop_done:;
19469  __pyx_v_step = __pyx_t_10;
19470 
19471  /* "View.MemoryView":764
19472  * step = index.step or 0
19473  *
19474  * have_start = index.start is not None # <<<<<<<<<<<<<<
19475  * have_stop = index.stop is not None
19476  * have_step = index.step is not None
19477  */
19478  __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
19479  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
19480  __Pyx_GOTREF(__pyx_t_9);
19481  __pyx_t_1 = (__pyx_t_9 != Py_None);
19482  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19483  __pyx_v_have_start = __pyx_t_1;
19484 
19485  /* "View.MemoryView":765
19486  *
19487  * have_start = index.start is not None
19488  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
19489  * have_step = index.step is not None
19490  *
19491  */
19492  __Pyx_TraceLine(765,0,__PYX_ERR(1, 765, __pyx_L1_error))
19493  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
19494  __Pyx_GOTREF(__pyx_t_9);
19495  __pyx_t_1 = (__pyx_t_9 != Py_None);
19496  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19497  __pyx_v_have_stop = __pyx_t_1;
19498 
19499  /* "View.MemoryView":766
19500  * have_start = index.start is not None
19501  * have_stop = index.stop is not None
19502  * have_step = index.step is not None # <<<<<<<<<<<<<<
19503  *
19504  * slice_memviewslice(
19505  */
19506  __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
19507  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
19508  __Pyx_GOTREF(__pyx_t_9);
19509  __pyx_t_1 = (__pyx_t_9 != Py_None);
19510  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19511  __pyx_v_have_step = __pyx_t_1;
19512 
19513  /* "View.MemoryView":768
19514  * have_step = index.step is not None
19515  *
19516  * slice_memviewslice( # <<<<<<<<<<<<<<
19517  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19518  * dim, new_ndim, p_suboffset_dim,
19519  */
19520  __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
19521  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
19522 
19523  /* "View.MemoryView":774
19524  * have_start, have_stop, have_step,
19525  * True)
19526  * new_ndim += 1 # <<<<<<<<<<<<<<
19527  *
19528  * if isinstance(memview, _memoryviewslice):
19529  */
19530  __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error))
19531  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19532  }
19533  __pyx_L6:;
19534 
19535  /* "View.MemoryView":746
19536  * cdef bint have_start, have_stop, have_step
19537  *
19538  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
19539  * if PyIndex_Check(index):
19540  * slice_memviewslice(
19541  */
19542  __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
19543  }
19544  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19545 
19546  /* "View.MemoryView":776
19547  * new_ndim += 1
19548  *
19549  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19550  * return memoryview_fromslice(dst, new_ndim,
19551  * memviewsliceobj.to_object_func,
19552  */
19553  __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
19554  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19555  __pyx_t_2 = (__pyx_t_1 != 0);
19556  if (__pyx_t_2) {
19557 
19558  /* "View.MemoryView":777
19559  *
19560  * if isinstance(memview, _memoryviewslice):
19561  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
19562  * memviewsliceobj.to_object_func,
19563  * memviewsliceobj.to_dtype_func,
19564  */
19565  __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
19566  __Pyx_XDECREF(((PyObject *)__pyx_r));
19567 
19568  /* "View.MemoryView":778
19569  * if isinstance(memview, _memoryviewslice):
19570  * return memoryview_fromslice(dst, new_ndim,
19571  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
19572  * memviewsliceobj.to_dtype_func,
19573  * memview.dtype_is_object)
19574  */
19575  __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
19576  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
19577 
19578  /* "View.MemoryView":779
19579  * return memoryview_fromslice(dst, new_ndim,
19580  * memviewsliceobj.to_object_func,
19581  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
19582  * memview.dtype_is_object)
19583  * else:
19584  */
19585  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
19586  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
19587 
19588  /* "View.MemoryView":777
19589  *
19590  * if isinstance(memview, _memoryviewslice):
19591  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
19592  * memviewsliceobj.to_object_func,
19593  * memviewsliceobj.to_dtype_func,
19594  */
19595  __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
19596  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
19597  __Pyx_GOTREF(__pyx_t_3);
19598  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
19599  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
19600  __pyx_t_3 = 0;
19601  goto __pyx_L0;
19602 
19603  /* "View.MemoryView":776
19604  * new_ndim += 1
19605  *
19606  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19607  * return memoryview_fromslice(dst, new_ndim,
19608  * memviewsliceobj.to_object_func,
19609  */
19610  }
19611 
19612  /* "View.MemoryView":782
19613  * memview.dtype_is_object)
19614  * else:
19615  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
19616  * memview.dtype_is_object)
19617  *
19618  */
19619  __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
19620  /*else*/ {
19621  __Pyx_XDECREF(((PyObject *)__pyx_r));
19622 
19623  /* "View.MemoryView":783
19624  * else:
19625  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
19626  * memview.dtype_is_object) # <<<<<<<<<<<<<<
19627  *
19628  *
19629  */
19630  __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error))
19631  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
19632  __Pyx_GOTREF(__pyx_t_3);
19633 
19634  /* "View.MemoryView":782
19635  * memview.dtype_is_object)
19636  * else:
19637  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
19638  * memview.dtype_is_object)
19639  *
19640  */
19641  __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
19642  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
19643  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
19644  __pyx_t_3 = 0;
19645  goto __pyx_L0;
19646  }
19647 
19648  /* "View.MemoryView":710
19649  *
19650  * @cname('__pyx_memview_slice')
19651  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
19652  * cdef int new_ndim = 0, suboffset_dim = -1, dim
19653  * cdef bint negative_step
19654  */
19655 
19656  /* function exit code */
19657  __pyx_L1_error:;
19658  __Pyx_XDECREF(__pyx_t_3);
19659  __Pyx_XDECREF(__pyx_t_9);
19660  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19661  __pyx_r = 0;
19662  __pyx_L0:;
19663  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
19664  __Pyx_XDECREF(__pyx_v_index);
19665  __Pyx_XGIVEREF((PyObject *)__pyx_r);
19666  __Pyx_TraceReturn(__pyx_r, 0);
19667  __Pyx_RefNannyFinishContext();
19668  return __pyx_r;
19669 }
19670 
19671 /* "View.MemoryView":807
19672  *
19673  * @cname('__pyx_memoryview_slice_memviewslice')
19674  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
19675  * __Pyx_memviewslice *dst,
19676  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
19677  */
19678 
19679 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
19680  Py_ssize_t __pyx_v_new_shape;
19681  int __pyx_v_negative_step;
19682  int __pyx_r;
19683  __Pyx_TraceDeclarations
19684  int __pyx_t_1;
19685  int __pyx_t_2;
19686  int __pyx_t_3;
19687  int __pyx_lineno = 0;
19688  const char *__pyx_filename = NULL;
19689  int __pyx_clineno = 0;
19690  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
19691 
19692  /* "View.MemoryView":827
19693  * cdef bint negative_step
19694  *
19695  * if not is_slice: # <<<<<<<<<<<<<<
19696  *
19697  * if start < 0:
19698  */
19699  __Pyx_TraceLine(827,1,__PYX_ERR(1, 827, __pyx_L1_error))
19700  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
19701  if (__pyx_t_1) {
19702 
19703  /* "View.MemoryView":829
19704  * if not is_slice:
19705  *
19706  * if start < 0: # <<<<<<<<<<<<<<
19707  * start += shape
19708  * if not 0 <= start < shape:
19709  */
19710  __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
19711  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
19712  if (__pyx_t_1) {
19713 
19714  /* "View.MemoryView":830
19715  *
19716  * if start < 0:
19717  * start += shape # <<<<<<<<<<<<<<
19718  * if not 0 <= start < shape:
19719  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19720  */
19721  __Pyx_TraceLine(830,1,__PYX_ERR(1, 830, __pyx_L1_error))
19722  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19723 
19724  /* "View.MemoryView":829
19725  * if not is_slice:
19726  *
19727  * if start < 0: # <<<<<<<<<<<<<<
19728  * start += shape
19729  * if not 0 <= start < shape:
19730  */
19731  }
19732 
19733  /* "View.MemoryView":831
19734  * if start < 0:
19735  * start += shape
19736  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
19737  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19738  * else:
19739  */
19740  __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
19741  __pyx_t_1 = (0 <= __pyx_v_start);
19742  if (__pyx_t_1) {
19743  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
19744  }
19745  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19746  if (__pyx_t_2) {
19747 
19748  /* "View.MemoryView":832
19749  * start += shape
19750  * if not 0 <= start < shape:
19751  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
19752  * else:
19753  *
19754  */
19755  __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
19756  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
19757 
19758  /* "View.MemoryView":831
19759  * if start < 0:
19760  * start += shape
19761  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
19762  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19763  * else:
19764  */
19765  }
19766 
19767  /* "View.MemoryView":827
19768  * cdef bint negative_step
19769  *
19770  * if not is_slice: # <<<<<<<<<<<<<<
19771  *
19772  * if start < 0:
19773  */
19774  goto __pyx_L3;
19775  }
19776 
19777  /* "View.MemoryView":835
19778  * else:
19779  *
19780  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
19781  *
19782  * if have_step and step == 0:
19783  */
19784  __Pyx_TraceLine(835,1,__PYX_ERR(1, 835, __pyx_L1_error))
19785  /*else*/ {
19786  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
19787  if (__pyx_t_1) {
19788  } else {
19789  __pyx_t_2 = __pyx_t_1;
19790  goto __pyx_L6_bool_binop_done;
19791  }
19792  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
19793  __pyx_t_2 = __pyx_t_1;
19794  __pyx_L6_bool_binop_done:;
19795  __pyx_v_negative_step = __pyx_t_2;
19796 
19797  /* "View.MemoryView":837
19798  * negative_step = have_step != 0 and step < 0
19799  *
19800  * if have_step and step == 0: # <<<<<<<<<<<<<<
19801  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
19802  *
19803  */
19804  __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
19805  __pyx_t_1 = (__pyx_v_have_step != 0);
19806  if (__pyx_t_1) {
19807  } else {
19808  __pyx_t_2 = __pyx_t_1;
19809  goto __pyx_L9_bool_binop_done;
19810  }
19811  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
19812  __pyx_t_2 = __pyx_t_1;
19813  __pyx_L9_bool_binop_done:;
19814  if (__pyx_t_2) {
19815 
19816  /* "View.MemoryView":838
19817  *
19818  * if have_step and step == 0:
19819  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
19820  *
19821  *
19822  */
19823  __Pyx_TraceLine(838,1,__PYX_ERR(1, 838, __pyx_L1_error))
19824  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
19825 
19826  /* "View.MemoryView":837
19827  * negative_step = have_step != 0 and step < 0
19828  *
19829  * if have_step and step == 0: # <<<<<<<<<<<<<<
19830  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
19831  *
19832  */
19833  }
19834 
19835  /* "View.MemoryView":841
19836  *
19837  *
19838  * if have_start: # <<<<<<<<<<<<<<
19839  * if start < 0:
19840  * start += shape
19841  */
19842  __Pyx_TraceLine(841,1,__PYX_ERR(1, 841, __pyx_L1_error))
19843  __pyx_t_2 = (__pyx_v_have_start != 0);
19844  if (__pyx_t_2) {
19845 
19846  /* "View.MemoryView":842
19847  *
19848  * if have_start:
19849  * if start < 0: # <<<<<<<<<<<<<<
19850  * start += shape
19851  * if start < 0:
19852  */
19853  __Pyx_TraceLine(842,1,__PYX_ERR(1, 842, __pyx_L1_error))
19854  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
19855  if (__pyx_t_2) {
19856 
19857  /* "View.MemoryView":843
19858  * if have_start:
19859  * if start < 0:
19860  * start += shape # <<<<<<<<<<<<<<
19861  * if start < 0:
19862  * start = 0
19863  */
19864  __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
19865  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19866 
19867  /* "View.MemoryView":844
19868  * if start < 0:
19869  * start += shape
19870  * if start < 0: # <<<<<<<<<<<<<<
19871  * start = 0
19872  * elif start >= shape:
19873  */
19874  __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
19875  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
19876  if (__pyx_t_2) {
19877 
19878  /* "View.MemoryView":845
19879  * start += shape
19880  * if start < 0:
19881  * start = 0 # <<<<<<<<<<<<<<
19882  * elif start >= shape:
19883  * if negative_step:
19884  */
19885  __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
19886  __pyx_v_start = 0;
19887 
19888  /* "View.MemoryView":844
19889  * if start < 0:
19890  * start += shape
19891  * if start < 0: # <<<<<<<<<<<<<<
19892  * start = 0
19893  * elif start >= shape:
19894  */
19895  }
19896 
19897  /* "View.MemoryView":842
19898  *
19899  * if have_start:
19900  * if start < 0: # <<<<<<<<<<<<<<
19901  * start += shape
19902  * if start < 0:
19903  */
19904  goto __pyx_L12;
19905  }
19906 
19907  /* "View.MemoryView":846
19908  * if start < 0:
19909  * start = 0
19910  * elif start >= shape: # <<<<<<<<<<<<<<
19911  * if negative_step:
19912  * start = shape - 1
19913  */
19914  __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
19915  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
19916  if (__pyx_t_2) {
19917 
19918  /* "View.MemoryView":847
19919  * start = 0
19920  * elif start >= shape:
19921  * if negative_step: # <<<<<<<<<<<<<<
19922  * start = shape - 1
19923  * else:
19924  */
19925  __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
19926  __pyx_t_2 = (__pyx_v_negative_step != 0);
19927  if (__pyx_t_2) {
19928 
19929  /* "View.MemoryView":848
19930  * elif start >= shape:
19931  * if negative_step:
19932  * start = shape - 1 # <<<<<<<<<<<<<<
19933  * else:
19934  * start = shape
19935  */
19936  __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
19937  __pyx_v_start = (__pyx_v_shape - 1);
19938 
19939  /* "View.MemoryView":847
19940  * start = 0
19941  * elif start >= shape:
19942  * if negative_step: # <<<<<<<<<<<<<<
19943  * start = shape - 1
19944  * else:
19945  */
19946  goto __pyx_L14;
19947  }
19948 
19949  /* "View.MemoryView":850
19950  * start = shape - 1
19951  * else:
19952  * start = shape # <<<<<<<<<<<<<<
19953  * else:
19954  * if negative_step:
19955  */
19956  __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
19957  /*else*/ {
19958  __pyx_v_start = __pyx_v_shape;
19959  }
19960  __pyx_L14:;
19961 
19962  /* "View.MemoryView":846
19963  * if start < 0:
19964  * start = 0
19965  * elif start >= shape: # <<<<<<<<<<<<<<
19966  * if negative_step:
19967  * start = shape - 1
19968  */
19969  }
19970  __pyx_L12:;
19971 
19972  /* "View.MemoryView":841
19973  *
19974  *
19975  * if have_start: # <<<<<<<<<<<<<<
19976  * if start < 0:
19977  * start += shape
19978  */
19979  goto __pyx_L11;
19980  }
19981 
19982  /* "View.MemoryView":852
19983  * start = shape
19984  * else:
19985  * if negative_step: # <<<<<<<<<<<<<<
19986  * start = shape - 1
19987  * else:
19988  */
19989  __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
19990  /*else*/ {
19991  __pyx_t_2 = (__pyx_v_negative_step != 0);
19992  if (__pyx_t_2) {
19993 
19994  /* "View.MemoryView":853
19995  * else:
19996  * if negative_step:
19997  * start = shape - 1 # <<<<<<<<<<<<<<
19998  * else:
19999  * start = 0
20000  */
20001  __Pyx_TraceLine(853,1,__PYX_ERR(1, 853, __pyx_L1_error))
20002  __pyx_v_start = (__pyx_v_shape - 1);
20003 
20004  /* "View.MemoryView":852
20005  * start = shape
20006  * else:
20007  * if negative_step: # <<<<<<<<<<<<<<
20008  * start = shape - 1
20009  * else:
20010  */
20011  goto __pyx_L15;
20012  }
20013 
20014  /* "View.MemoryView":855
20015  * start = shape - 1
20016  * else:
20017  * start = 0 # <<<<<<<<<<<<<<
20018  *
20019  * if have_stop:
20020  */
20021  __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
20022  /*else*/ {
20023  __pyx_v_start = 0;
20024  }
20025  __pyx_L15:;
20026  }
20027  __pyx_L11:;
20028 
20029  /* "View.MemoryView":857
20030  * start = 0
20031  *
20032  * if have_stop: # <<<<<<<<<<<<<<
20033  * if stop < 0:
20034  * stop += shape
20035  */
20036  __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
20037  __pyx_t_2 = (__pyx_v_have_stop != 0);
20038  if (__pyx_t_2) {
20039 
20040  /* "View.MemoryView":858
20041  *
20042  * if have_stop:
20043  * if stop < 0: # <<<<<<<<<<<<<<
20044  * stop += shape
20045  * if stop < 0:
20046  */
20047  __Pyx_TraceLine(858,1,__PYX_ERR(1, 858, __pyx_L1_error))
20048  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20049  if (__pyx_t_2) {
20050 
20051  /* "View.MemoryView":859
20052  * if have_stop:
20053  * if stop < 0:
20054  * stop += shape # <<<<<<<<<<<<<<
20055  * if stop < 0:
20056  * stop = 0
20057  */
20058  __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
20059  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
20060 
20061  /* "View.MemoryView":860
20062  * if stop < 0:
20063  * stop += shape
20064  * if stop < 0: # <<<<<<<<<<<<<<
20065  * stop = 0
20066  * elif stop > shape:
20067  */
20068  __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
20069  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20070  if (__pyx_t_2) {
20071 
20072  /* "View.MemoryView":861
20073  * stop += shape
20074  * if stop < 0:
20075  * stop = 0 # <<<<<<<<<<<<<<
20076  * elif stop > shape:
20077  * stop = shape
20078  */
20079  __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
20080  __pyx_v_stop = 0;
20081 
20082  /* "View.MemoryView":860
20083  * if stop < 0:
20084  * stop += shape
20085  * if stop < 0: # <<<<<<<<<<<<<<
20086  * stop = 0
20087  * elif stop > shape:
20088  */
20089  }
20090 
20091  /* "View.MemoryView":858
20092  *
20093  * if have_stop:
20094  * if stop < 0: # <<<<<<<<<<<<<<
20095  * stop += shape
20096  * if stop < 0:
20097  */
20098  goto __pyx_L17;
20099  }
20100 
20101  /* "View.MemoryView":862
20102  * if stop < 0:
20103  * stop = 0
20104  * elif stop > shape: # <<<<<<<<<<<<<<
20105  * stop = shape
20106  * else:
20107  */
20108  __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
20109  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
20110  if (__pyx_t_2) {
20111 
20112  /* "View.MemoryView":863
20113  * stop = 0
20114  * elif stop > shape:
20115  * stop = shape # <<<<<<<<<<<<<<
20116  * else:
20117  * if negative_step:
20118  */
20119  __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
20120  __pyx_v_stop = __pyx_v_shape;
20121 
20122  /* "View.MemoryView":862
20123  * if stop < 0:
20124  * stop = 0
20125  * elif stop > shape: # <<<<<<<<<<<<<<
20126  * stop = shape
20127  * else:
20128  */
20129  }
20130  __pyx_L17:;
20131 
20132  /* "View.MemoryView":857
20133  * start = 0
20134  *
20135  * if have_stop: # <<<<<<<<<<<<<<
20136  * if stop < 0:
20137  * stop += shape
20138  */
20139  goto __pyx_L16;
20140  }
20141 
20142  /* "View.MemoryView":865
20143  * stop = shape
20144  * else:
20145  * if negative_step: # <<<<<<<<<<<<<<
20146  * stop = -1
20147  * else:
20148  */
20149  __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
20150  /*else*/ {
20151  __pyx_t_2 = (__pyx_v_negative_step != 0);
20152  if (__pyx_t_2) {
20153 
20154  /* "View.MemoryView":866
20155  * else:
20156  * if negative_step:
20157  * stop = -1 # <<<<<<<<<<<<<<
20158  * else:
20159  * stop = shape
20160  */
20161  __Pyx_TraceLine(866,1,__PYX_ERR(1, 866, __pyx_L1_error))
20162  __pyx_v_stop = -1L;
20163 
20164  /* "View.MemoryView":865
20165  * stop = shape
20166  * else:
20167  * if negative_step: # <<<<<<<<<<<<<<
20168  * stop = -1
20169  * else:
20170  */
20171  goto __pyx_L19;
20172  }
20173 
20174  /* "View.MemoryView":868
20175  * stop = -1
20176  * else:
20177  * stop = shape # <<<<<<<<<<<<<<
20178  *
20179  * if not have_step:
20180  */
20181  __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
20182  /*else*/ {
20183  __pyx_v_stop = __pyx_v_shape;
20184  }
20185  __pyx_L19:;
20186  }
20187  __pyx_L16:;
20188 
20189  /* "View.MemoryView":870
20190  * stop = shape
20191  *
20192  * if not have_step: # <<<<<<<<<<<<<<
20193  * step = 1
20194  *
20195  */
20196  __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
20197  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
20198  if (__pyx_t_2) {
20199 
20200  /* "View.MemoryView":871
20201  *
20202  * if not have_step:
20203  * step = 1 # <<<<<<<<<<<<<<
20204  *
20205  *
20206  */
20207  __Pyx_TraceLine(871,1,__PYX_ERR(1, 871, __pyx_L1_error))
20208  __pyx_v_step = 1;
20209 
20210  /* "View.MemoryView":870
20211  * stop = shape
20212  *
20213  * if not have_step: # <<<<<<<<<<<<<<
20214  * step = 1
20215  *
20216  */
20217  }
20218 
20219  /* "View.MemoryView":875
20220  *
20221  * with cython.cdivision(True):
20222  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
20223  *
20224  * if (stop - start) - step * new_shape:
20225  */
20226  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
20227 
20228  /* "View.MemoryView":877
20229  * new_shape = (stop - start) // step
20230  *
20231  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
20232  * new_shape += 1
20233  *
20234  */
20235  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
20236  if (__pyx_t_2) {
20237 
20238  /* "View.MemoryView":878
20239  *
20240  * if (stop - start) - step * new_shape:
20241  * new_shape += 1 # <<<<<<<<<<<<<<
20242  *
20243  * if new_shape < 0:
20244  */
20245  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
20246 
20247  /* "View.MemoryView":877
20248  * new_shape = (stop - start) // step
20249  *
20250  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
20251  * new_shape += 1
20252  *
20253  */
20254  }
20255 
20256  /* "View.MemoryView":880
20257  * new_shape += 1
20258  *
20259  * if new_shape < 0: # <<<<<<<<<<<<<<
20260  * new_shape = 0
20261  *
20262  */
20263  __Pyx_TraceLine(880,1,__PYX_ERR(1, 880, __pyx_L1_error))
20264  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
20265  if (__pyx_t_2) {
20266 
20267  /* "View.MemoryView":881
20268  *
20269  * if new_shape < 0:
20270  * new_shape = 0 # <<<<<<<<<<<<<<
20271  *
20272  *
20273  */
20274  __Pyx_TraceLine(881,1,__PYX_ERR(1, 881, __pyx_L1_error))
20275  __pyx_v_new_shape = 0;
20276 
20277  /* "View.MemoryView":880
20278  * new_shape += 1
20279  *
20280  * if new_shape < 0: # <<<<<<<<<<<<<<
20281  * new_shape = 0
20282  *
20283  */
20284  }
20285 
20286  /* "View.MemoryView":884
20287  *
20288  *
20289  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
20290  * dst.shape[new_ndim] = new_shape
20291  * dst.suboffsets[new_ndim] = suboffset
20292  */
20293  __Pyx_TraceLine(884,1,__PYX_ERR(1, 884, __pyx_L1_error))
20294  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
20295 
20296  /* "View.MemoryView":885
20297  *
20298  * dst.strides[new_ndim] = stride * step
20299  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
20300  * dst.suboffsets[new_ndim] = suboffset
20301  *
20302  */
20303  __Pyx_TraceLine(885,1,__PYX_ERR(1, 885, __pyx_L1_error))
20304  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
20305 
20306  /* "View.MemoryView":886
20307  * dst.strides[new_ndim] = stride * step
20308  * dst.shape[new_ndim] = new_shape
20309  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
20310  *
20311  *
20312  */
20313  __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
20314  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
20315  }
20316  __pyx_L3:;
20317 
20318  /* "View.MemoryView":889
20319  *
20320  *
20321  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
20322  * dst.data += start * stride
20323  * else:
20324  */
20325  __Pyx_TraceLine(889,1,__PYX_ERR(1, 889, __pyx_L1_error))
20326  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
20327  if (__pyx_t_2) {
20328 
20329  /* "View.MemoryView":890
20330  *
20331  * if suboffset_dim[0] < 0:
20332  * dst.data += start * stride # <<<<<<<<<<<<<<
20333  * else:
20334  * dst.suboffsets[suboffset_dim[0]] += start * stride
20335  */
20336  __Pyx_TraceLine(890,1,__PYX_ERR(1, 890, __pyx_L1_error))
20337  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
20338 
20339  /* "View.MemoryView":889
20340  *
20341  *
20342  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
20343  * dst.data += start * stride
20344  * else:
20345  */
20346  goto __pyx_L23;
20347  }
20348 
20349  /* "View.MemoryView":892
20350  * dst.data += start * stride
20351  * else:
20352  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
20353  *
20354  * if suboffset >= 0:
20355  */
20356  __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
20357  /*else*/ {
20358  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
20359  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
20360  }
20361  __pyx_L23:;
20362 
20363  /* "View.MemoryView":894
20364  * dst.suboffsets[suboffset_dim[0]] += start * stride
20365  *
20366  * if suboffset >= 0: # <<<<<<<<<<<<<<
20367  * if not is_slice:
20368  * if new_ndim == 0:
20369  */
20370  __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
20371  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
20372  if (__pyx_t_2) {
20373 
20374  /* "View.MemoryView":895
20375  *
20376  * if suboffset >= 0:
20377  * if not is_slice: # <<<<<<<<<<<<<<
20378  * if new_ndim == 0:
20379  * dst.data = (<char **> dst.data)[0] + suboffset
20380  */
20381  __Pyx_TraceLine(895,1,__PYX_ERR(1, 895, __pyx_L1_error))
20382  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
20383  if (__pyx_t_2) {
20384 
20385  /* "View.MemoryView":896
20386  * if suboffset >= 0:
20387  * if not is_slice:
20388  * if new_ndim == 0: # <<<<<<<<<<<<<<
20389  * dst.data = (<char **> dst.data)[0] + suboffset
20390  * else:
20391  */
20392  __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
20393  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
20394  if (__pyx_t_2) {
20395 
20396  /* "View.MemoryView":897
20397  * if not is_slice:
20398  * if new_ndim == 0:
20399  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
20400  * else:
20401  * _err_dim(IndexError, "All dimensions preceding dimension %d "
20402  */
20403  __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
20404  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
20405 
20406  /* "View.MemoryView":896
20407  * if suboffset >= 0:
20408  * if not is_slice:
20409  * if new_ndim == 0: # <<<<<<<<<<<<<<
20410  * dst.data = (<char **> dst.data)[0] + suboffset
20411  * else:
20412  */
20413  goto __pyx_L26;
20414  }
20415 
20416  /* "View.MemoryView":899
20417  * dst.data = (<char **> dst.data)[0] + suboffset
20418  * else:
20419  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
20420  * "must be indexed and not sliced", dim)
20421  * else:
20422  */
20423  __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
20424  /*else*/ {
20425 
20426  /* "View.MemoryView":900
20427  * else:
20428  * _err_dim(IndexError, "All dimensions preceding dimension %d "
20429  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
20430  * else:
20431  * suboffset_dim[0] = new_ndim
20432  */
20433  __Pyx_TraceLine(900,1,__PYX_ERR(1, 900, __pyx_L1_error))
20434  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
20435  }
20436  __pyx_L26:;
20437 
20438  /* "View.MemoryView":895
20439  *
20440  * if suboffset >= 0:
20441  * if not is_slice: # <<<<<<<<<<<<<<
20442  * if new_ndim == 0:
20443  * dst.data = (<char **> dst.data)[0] + suboffset
20444  */
20445  goto __pyx_L25;
20446  }
20447 
20448  /* "View.MemoryView":902
20449  * "must be indexed and not sliced", dim)
20450  * else:
20451  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
20452  *
20453  * return 0
20454  */
20455  __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
20456  /*else*/ {
20457  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
20458  }
20459  __pyx_L25:;
20460 
20461  /* "View.MemoryView":894
20462  * dst.suboffsets[suboffset_dim[0]] += start * stride
20463  *
20464  * if suboffset >= 0: # <<<<<<<<<<<<<<
20465  * if not is_slice:
20466  * if new_ndim == 0:
20467  */
20468  }
20469 
20470  /* "View.MemoryView":904
20471  * suboffset_dim[0] = new_ndim
20472  *
20473  * return 0 # <<<<<<<<<<<<<<
20474  *
20475  *
20476  */
20477  __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
20478  __pyx_r = 0;
20479  goto __pyx_L0;
20480 
20481  /* "View.MemoryView":807
20482  *
20483  * @cname('__pyx_memoryview_slice_memviewslice')
20484  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
20485  * __Pyx_memviewslice *dst,
20486  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
20487  */
20488 
20489  /* function exit code */
20490  __pyx_L1_error:;
20491  {
20492  #ifdef WITH_THREAD
20493  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20494  #endif
20495  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20496  #ifdef WITH_THREAD
20497  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20498  #endif
20499  }
20500  __pyx_r = -1;
20501  __pyx_L0:;
20502  __Pyx_TraceReturn(Py_None, 1);
20503  return __pyx_r;
20504 }
20505 
20506 /* "View.MemoryView":910
20507  *
20508  * @cname('__pyx_pybuffer_index')
20509  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
20510  * Py_ssize_t dim) except NULL:
20511  * cdef Py_ssize_t shape, stride, suboffset = -1
20512  */
20513 
20514 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
20515  Py_ssize_t __pyx_v_shape;
20516  Py_ssize_t __pyx_v_stride;
20517  Py_ssize_t __pyx_v_suboffset;
20518  Py_ssize_t __pyx_v_itemsize;
20519  char *__pyx_v_resultp;
20520  char *__pyx_r;
20521  __Pyx_TraceDeclarations
20522  __Pyx_RefNannyDeclarations
20523  Py_ssize_t __pyx_t_1;
20524  int __pyx_t_2;
20525  PyObject *__pyx_t_3 = NULL;
20526  PyObject *__pyx_t_4 = NULL;
20527  int __pyx_lineno = 0;
20528  const char *__pyx_filename = NULL;
20529  int __pyx_clineno = 0;
20530  __Pyx_RefNannySetupContext("pybuffer_index", 0);
20531  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
20532 
20533  /* "View.MemoryView":912
20534  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
20535  * Py_ssize_t dim) except NULL:
20536  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
20537  * cdef Py_ssize_t itemsize = view.itemsize
20538  * cdef char *resultp
20539  */
20540  __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
20541  __pyx_v_suboffset = -1L;
20542 
20543  /* "View.MemoryView":913
20544  * Py_ssize_t dim) except NULL:
20545  * cdef Py_ssize_t shape, stride, suboffset = -1
20546  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
20547  * cdef char *resultp
20548  *
20549  */
20550  __Pyx_TraceLine(913,0,__PYX_ERR(1, 913, __pyx_L1_error))
20551  __pyx_t_1 = __pyx_v_view->itemsize;
20552  __pyx_v_itemsize = __pyx_t_1;
20553 
20554  /* "View.MemoryView":916
20555  * cdef char *resultp
20556  *
20557  * if view.ndim == 0: # <<<<<<<<<<<<<<
20558  * shape = view.len / itemsize
20559  * stride = itemsize
20560  */
20561  __Pyx_TraceLine(916,0,__PYX_ERR(1, 916, __pyx_L1_error))
20562  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
20563  if (__pyx_t_2) {
20564 
20565  /* "View.MemoryView":917
20566  *
20567  * if view.ndim == 0:
20568  * shape = view.len / itemsize # <<<<<<<<<<<<<<
20569  * stride = itemsize
20570  * else:
20571  */
20572  __Pyx_TraceLine(917,0,__PYX_ERR(1, 917, __pyx_L1_error))
20573  if (unlikely(__pyx_v_itemsize == 0)) {
20574  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
20575  __PYX_ERR(1, 917, __pyx_L1_error)
20576  }
20577  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
20578  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
20579  __PYX_ERR(1, 917, __pyx_L1_error)
20580  }
20581  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
20582 
20583  /* "View.MemoryView":918
20584  * if view.ndim == 0:
20585  * shape = view.len / itemsize
20586  * stride = itemsize # <<<<<<<<<<<<<<
20587  * else:
20588  * shape = view.shape[dim]
20589  */
20590  __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
20591  __pyx_v_stride = __pyx_v_itemsize;
20592 
20593  /* "View.MemoryView":916
20594  * cdef char *resultp
20595  *
20596  * if view.ndim == 0: # <<<<<<<<<<<<<<
20597  * shape = view.len / itemsize
20598  * stride = itemsize
20599  */
20600  goto __pyx_L3;
20601  }
20602 
20603  /* "View.MemoryView":920
20604  * stride = itemsize
20605  * else:
20606  * shape = view.shape[dim] # <<<<<<<<<<<<<<
20607  * stride = view.strides[dim]
20608  * if view.suboffsets != NULL:
20609  */
20610  __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
20611  /*else*/ {
20612  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
20613 
20614  /* "View.MemoryView":921
20615  * else:
20616  * shape = view.shape[dim]
20617  * stride = view.strides[dim] # <<<<<<<<<<<<<<
20618  * if view.suboffsets != NULL:
20619  * suboffset = view.suboffsets[dim]
20620  */
20621  __Pyx_TraceLine(921,0,__PYX_ERR(1, 921, __pyx_L1_error))
20622  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
20623 
20624  /* "View.MemoryView":922
20625  * shape = view.shape[dim]
20626  * stride = view.strides[dim]
20627  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
20628  * suboffset = view.suboffsets[dim]
20629  *
20630  */
20631  __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
20632  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
20633  if (__pyx_t_2) {
20634 
20635  /* "View.MemoryView":923
20636  * stride = view.strides[dim]
20637  * if view.suboffsets != NULL:
20638  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
20639  *
20640  * if index < 0:
20641  */
20642  __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
20643  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
20644 
20645  /* "View.MemoryView":922
20646  * shape = view.shape[dim]
20647  * stride = view.strides[dim]
20648  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
20649  * suboffset = view.suboffsets[dim]
20650  *
20651  */
20652  }
20653  }
20654  __pyx_L3:;
20655 
20656  /* "View.MemoryView":925
20657  * suboffset = view.suboffsets[dim]
20658  *
20659  * if index < 0: # <<<<<<<<<<<<<<
20660  * index += view.shape[dim]
20661  * if index < 0:
20662  */
20663  __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
20664  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20665  if (__pyx_t_2) {
20666 
20667  /* "View.MemoryView":926
20668  *
20669  * if index < 0:
20670  * index += view.shape[dim] # <<<<<<<<<<<<<<
20671  * if index < 0:
20672  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20673  */
20674  __Pyx_TraceLine(926,0,__PYX_ERR(1, 926, __pyx_L1_error))
20675  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
20676 
20677  /* "View.MemoryView":927
20678  * if index < 0:
20679  * index += view.shape[dim]
20680  * if index < 0: # <<<<<<<<<<<<<<
20681  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20682  *
20683  */
20684  __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
20685  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20686  if (unlikely(__pyx_t_2)) {
20687 
20688  /* "View.MemoryView":928
20689  * index += view.shape[dim]
20690  * if index < 0:
20691  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
20692  *
20693  * if index >= shape:
20694  */
20695  __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
20696  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
20697  __Pyx_GOTREF(__pyx_t_3);
20698  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
20699  __Pyx_GOTREF(__pyx_t_4);
20700  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20701  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
20702  __Pyx_GOTREF(__pyx_t_3);
20703  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20704  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20705  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20706  __PYX_ERR(1, 928, __pyx_L1_error)
20707 
20708  /* "View.MemoryView":927
20709  * if index < 0:
20710  * index += view.shape[dim]
20711  * if index < 0: # <<<<<<<<<<<<<<
20712  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20713  *
20714  */
20715  }
20716 
20717  /* "View.MemoryView":925
20718  * suboffset = view.suboffsets[dim]
20719  *
20720  * if index < 0: # <<<<<<<<<<<<<<
20721  * index += view.shape[dim]
20722  * if index < 0:
20723  */
20724  }
20725 
20726  /* "View.MemoryView":930
20727  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20728  *
20729  * if index >= shape: # <<<<<<<<<<<<<<
20730  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20731  *
20732  */
20733  __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
20734  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
20735  if (unlikely(__pyx_t_2)) {
20736 
20737  /* "View.MemoryView":931
20738  *
20739  * if index >= shape:
20740  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
20741  *
20742  * resultp = bufp + index * stride
20743  */
20744  __Pyx_TraceLine(931,0,__PYX_ERR(1, 931, __pyx_L1_error))
20745  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
20746  __Pyx_GOTREF(__pyx_t_3);
20747  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
20748  __Pyx_GOTREF(__pyx_t_4);
20749  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20750  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
20751  __Pyx_GOTREF(__pyx_t_3);
20752  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20753  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20754  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20755  __PYX_ERR(1, 931, __pyx_L1_error)
20756 
20757  /* "View.MemoryView":930
20758  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20759  *
20760  * if index >= shape: # <<<<<<<<<<<<<<
20761  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20762  *
20763  */
20764  }
20765 
20766  /* "View.MemoryView":933
20767  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20768  *
20769  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
20770  * if suboffset >= 0:
20771  * resultp = (<char **> resultp)[0] + suboffset
20772  */
20773  __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
20774  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
20775 
20776  /* "View.MemoryView":934
20777  *
20778  * resultp = bufp + index * stride
20779  * if suboffset >= 0: # <<<<<<<<<<<<<<
20780  * resultp = (<char **> resultp)[0] + suboffset
20781  *
20782  */
20783  __Pyx_TraceLine(934,0,__PYX_ERR(1, 934, __pyx_L1_error))
20784  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
20785  if (__pyx_t_2) {
20786 
20787  /* "View.MemoryView":935
20788  * resultp = bufp + index * stride
20789  * if suboffset >= 0:
20790  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
20791  *
20792  * return resultp
20793  */
20794  __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
20795  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
20796 
20797  /* "View.MemoryView":934
20798  *
20799  * resultp = bufp + index * stride
20800  * if suboffset >= 0: # <<<<<<<<<<<<<<
20801  * resultp = (<char **> resultp)[0] + suboffset
20802  *
20803  */
20804  }
20805 
20806  /* "View.MemoryView":937
20807  * resultp = (<char **> resultp)[0] + suboffset
20808  *
20809  * return resultp # <<<<<<<<<<<<<<
20810  *
20811  *
20812  */
20813  __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
20814  __pyx_r = __pyx_v_resultp;
20815  goto __pyx_L0;
20816 
20817  /* "View.MemoryView":910
20818  *
20819  * @cname('__pyx_pybuffer_index')
20820  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
20821  * Py_ssize_t dim) except NULL:
20822  * cdef Py_ssize_t shape, stride, suboffset = -1
20823  */
20824 
20825  /* function exit code */
20826  __pyx_L1_error:;
20827  __Pyx_XDECREF(__pyx_t_3);
20828  __Pyx_XDECREF(__pyx_t_4);
20829  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
20830  __pyx_r = NULL;
20831  __pyx_L0:;
20832  __Pyx_TraceReturn(Py_None, 0);
20833  __Pyx_RefNannyFinishContext();
20834  return __pyx_r;
20835 }
20836 
20837 /* "View.MemoryView":943
20838  *
20839  * @cname('__pyx_memslice_transpose')
20840  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
20841  * cdef int ndim = memslice.memview.view.ndim
20842  *
20843  */
20844 
20845 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
20846  int __pyx_v_ndim;
20847  Py_ssize_t *__pyx_v_shape;
20848  Py_ssize_t *__pyx_v_strides;
20849  int __pyx_v_i;
20850  int __pyx_v_j;
20851  int __pyx_r;
20852  __Pyx_TraceDeclarations
20853  int __pyx_t_1;
20854  Py_ssize_t *__pyx_t_2;
20855  long __pyx_t_3;
20856  long __pyx_t_4;
20857  Py_ssize_t __pyx_t_5;
20858  Py_ssize_t __pyx_t_6;
20859  int __pyx_t_7;
20860  int __pyx_t_8;
20861  int __pyx_t_9;
20862  int __pyx_lineno = 0;
20863  const char *__pyx_filename = NULL;
20864  int __pyx_clineno = 0;
20865  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
20866 
20867  /* "View.MemoryView":944
20868  * @cname('__pyx_memslice_transpose')
20869  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
20870  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
20871  *
20872  * cdef Py_ssize_t *shape = memslice.shape
20873  */
20874  __Pyx_TraceLine(944,1,__PYX_ERR(1, 944, __pyx_L1_error))
20875  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
20876  __pyx_v_ndim = __pyx_t_1;
20877 
20878  /* "View.MemoryView":946
20879  * cdef int ndim = memslice.memview.view.ndim
20880  *
20881  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
20882  * cdef Py_ssize_t *strides = memslice.strides
20883  *
20884  */
20885  __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
20886  __pyx_t_2 = __pyx_v_memslice->shape;
20887  __pyx_v_shape = __pyx_t_2;
20888 
20889  /* "View.MemoryView":947
20890  *
20891  * cdef Py_ssize_t *shape = memslice.shape
20892  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
20893  *
20894  *
20895  */
20896  __Pyx_TraceLine(947,1,__PYX_ERR(1, 947, __pyx_L1_error))
20897  __pyx_t_2 = __pyx_v_memslice->strides;
20898  __pyx_v_strides = __pyx_t_2;
20899 
20900  /* "View.MemoryView":951
20901  *
20902  * cdef int i, j
20903  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
20904  * j = ndim - 1 - i
20905  * strides[i], strides[j] = strides[j], strides[i]
20906  */
20907  __Pyx_TraceLine(951,1,__PYX_ERR(1, 951, __pyx_L1_error))
20908  __pyx_t_3 = (__pyx_v_ndim / 2);
20909  __pyx_t_4 = __pyx_t_3;
20910  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
20911  __pyx_v_i = __pyx_t_1;
20912 
20913  /* "View.MemoryView":952
20914  * cdef int i, j
20915  * for i in range(ndim / 2):
20916  * j = ndim - 1 - i # <<<<<<<<<<<<<<
20917  * strides[i], strides[j] = strides[j], strides[i]
20918  * shape[i], shape[j] = shape[j], shape[i]
20919  */
20920  __Pyx_TraceLine(952,1,__PYX_ERR(1, 952, __pyx_L1_error))
20921  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
20922 
20923  /* "View.MemoryView":953
20924  * for i in range(ndim / 2):
20925  * j = ndim - 1 - i
20926  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
20927  * shape[i], shape[j] = shape[j], shape[i]
20928  *
20929  */
20930  __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
20931  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
20932  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
20933  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
20934  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
20935 
20936  /* "View.MemoryView":954
20937  * j = ndim - 1 - i
20938  * strides[i], strides[j] = strides[j], strides[i]
20939  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
20940  *
20941  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
20942  */
20943  __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
20944  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
20945  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
20946  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
20947  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
20948 
20949  /* "View.MemoryView":956
20950  * shape[i], shape[j] = shape[j], shape[i]
20951  *
20952  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
20953  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
20954  *
20955  */
20956  __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
20957  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
20958  if (!__pyx_t_8) {
20959  } else {
20960  __pyx_t_7 = __pyx_t_8;
20961  goto __pyx_L6_bool_binop_done;
20962  }
20963  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
20964  __pyx_t_7 = __pyx_t_8;
20965  __pyx_L6_bool_binop_done:;
20966  if (__pyx_t_7) {
20967 
20968  /* "View.MemoryView":957
20969  *
20970  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
20971  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
20972  *
20973  * return 1
20974  */
20975  __Pyx_TraceLine(957,1,__PYX_ERR(1, 957, __pyx_L1_error))
20976  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
20977 
20978  /* "View.MemoryView":956
20979  * shape[i], shape[j] = shape[j], shape[i]
20980  *
20981  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
20982  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
20983  *
20984  */
20985  }
20986  }
20987 
20988  /* "View.MemoryView":959
20989  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
20990  *
20991  * return 1 # <<<<<<<<<<<<<<
20992  *
20993  *
20994  */
20995  __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
20996  __pyx_r = 1;
20997  goto __pyx_L0;
20998 
20999  /* "View.MemoryView":943
21000  *
21001  * @cname('__pyx_memslice_transpose')
21002  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
21003  * cdef int ndim = memslice.memview.view.ndim
21004  *
21005  */
21006 
21007  /* function exit code */
21008  __pyx_L1_error:;
21009  {
21010  #ifdef WITH_THREAD
21011  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21012  #endif
21013  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21014  #ifdef WITH_THREAD
21015  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21016  #endif
21017  }
21018  __pyx_r = 0;
21019  __pyx_L0:;
21020  __Pyx_TraceReturn(Py_None, 1);
21021  return __pyx_r;
21022 }
21023 
21024 /* "View.MemoryView":976
21025  * cdef int (*to_dtype_func)(char *, object) except 0
21026  *
21027  * def __dealloc__(self): # <<<<<<<<<<<<<<
21028  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21029  *
21030  */
21031 
21032 /* Python wrapper */
21033 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
21034 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
21035  __Pyx_RefNannyDeclarations
21036  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
21037  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21038 
21039  /* function exit code */
21040  __Pyx_RefNannyFinishContext();
21041 }
21042 
21043 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21044  __Pyx_TraceDeclarations
21045  __Pyx_RefNannyDeclarations
21046  int __pyx_lineno = 0;
21047  const char *__pyx_filename = NULL;
21048  int __pyx_clineno = 0;
21049  __Pyx_RefNannySetupContext("__dealloc__", 0);
21050  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
21051 
21052  /* "View.MemoryView":977
21053  *
21054  * def __dealloc__(self):
21055  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
21056  *
21057  * cdef convert_item_to_object(self, char *itemp):
21058  */
21059  __Pyx_TraceLine(977,0,__PYX_ERR(1, 977, __pyx_L1_error))
21060  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
21061 
21062  /* "View.MemoryView":976
21063  * cdef int (*to_dtype_func)(char *, object) except 0
21064  *
21065  * def __dealloc__(self): # <<<<<<<<<<<<<<
21066  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21067  *
21068  */
21069 
21070  /* function exit code */
21071  goto __pyx_L0;
21072  __pyx_L1_error:;
21073  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21074  __pyx_L0:;
21075  __Pyx_TraceReturn(Py_None, 0);
21076  __Pyx_RefNannyFinishContext();
21077 }
21078 
21079 /* "View.MemoryView":979
21080  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21081  *
21082  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
21083  * if self.to_object_func != NULL:
21084  * return self.to_object_func(itemp)
21085  */
21086 
21087 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
21088  PyObject *__pyx_r = NULL;
21089  __Pyx_TraceDeclarations
21090  __Pyx_RefNannyDeclarations
21091  int __pyx_t_1;
21092  PyObject *__pyx_t_2 = NULL;
21093  int __pyx_lineno = 0;
21094  const char *__pyx_filename = NULL;
21095  int __pyx_clineno = 0;
21096  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
21097  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
21098 
21099  /* "View.MemoryView":980
21100  *
21101  * cdef convert_item_to_object(self, char *itemp):
21102  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
21103  * return self.to_object_func(itemp)
21104  * else:
21105  */
21106  __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error))
21107  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
21108  if (__pyx_t_1) {
21109 
21110  /* "View.MemoryView":981
21111  * cdef convert_item_to_object(self, char *itemp):
21112  * if self.to_object_func != NULL:
21113  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
21114  * else:
21115  * return memoryview.convert_item_to_object(self, itemp)
21116  */
21117  __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
21118  __Pyx_XDECREF(__pyx_r);
21119  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
21120  __Pyx_GOTREF(__pyx_t_2);
21121  __pyx_r = __pyx_t_2;
21122  __pyx_t_2 = 0;
21123  goto __pyx_L0;
21124 
21125  /* "View.MemoryView":980
21126  *
21127  * cdef convert_item_to_object(self, char *itemp):
21128  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
21129  * return self.to_object_func(itemp)
21130  * else:
21131  */
21132  }
21133 
21134  /* "View.MemoryView":983
21135  * return self.to_object_func(itemp)
21136  * else:
21137  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
21138  *
21139  * cdef assign_item_from_object(self, char *itemp, object value):
21140  */
21141  __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
21142  /*else*/ {
21143  __Pyx_XDECREF(__pyx_r);
21144  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
21145  __Pyx_GOTREF(__pyx_t_2);
21146  __pyx_r = __pyx_t_2;
21147  __pyx_t_2 = 0;
21148  goto __pyx_L0;
21149  }
21150 
21151  /* "View.MemoryView":979
21152  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21153  *
21154  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
21155  * if self.to_object_func != NULL:
21156  * return self.to_object_func(itemp)
21157  */
21158 
21159  /* function exit code */
21160  __pyx_L1_error:;
21161  __Pyx_XDECREF(__pyx_t_2);
21162  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21163  __pyx_r = 0;
21164  __pyx_L0:;
21165  __Pyx_XGIVEREF(__pyx_r);
21166  __Pyx_TraceReturn(__pyx_r, 0);
21167  __Pyx_RefNannyFinishContext();
21168  return __pyx_r;
21169 }
21170 
21171 /* "View.MemoryView":985
21172  * return memoryview.convert_item_to_object(self, itemp)
21173  *
21174  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
21175  * if self.to_dtype_func != NULL:
21176  * self.to_dtype_func(itemp, value)
21177  */
21178 
21179 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
21180  PyObject *__pyx_r = NULL;
21181  __Pyx_TraceDeclarations
21182  __Pyx_RefNannyDeclarations
21183  int __pyx_t_1;
21184  int __pyx_t_2;
21185  PyObject *__pyx_t_3 = NULL;
21186  int __pyx_lineno = 0;
21187  const char *__pyx_filename = NULL;
21188  int __pyx_clineno = 0;
21189  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
21190  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
21191 
21192  /* "View.MemoryView":986
21193  *
21194  * cdef assign_item_from_object(self, char *itemp, object value):
21195  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
21196  * self.to_dtype_func(itemp, value)
21197  * else:
21198  */
21199  __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error))
21200  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
21201  if (__pyx_t_1) {
21202 
21203  /* "View.MemoryView":987
21204  * cdef assign_item_from_object(self, char *itemp, object value):
21205  * if self.to_dtype_func != NULL:
21206  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
21207  * else:
21208  * memoryview.assign_item_from_object(self, itemp, value)
21209  */
21210  __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
21211  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
21212 
21213  /* "View.MemoryView":986
21214  *
21215  * cdef assign_item_from_object(self, char *itemp, object value):
21216  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
21217  * self.to_dtype_func(itemp, value)
21218  * else:
21219  */
21220  goto __pyx_L3;
21221  }
21222 
21223  /* "View.MemoryView":989
21224  * self.to_dtype_func(itemp, value)
21225  * else:
21226  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
21227  *
21228  * @property
21229  */
21230  __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
21231  /*else*/ {
21232  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
21233  __Pyx_GOTREF(__pyx_t_3);
21234  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21235  }
21236  __pyx_L3:;
21237 
21238  /* "View.MemoryView":985
21239  * return memoryview.convert_item_to_object(self, itemp)
21240  *
21241  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
21242  * if self.to_dtype_func != NULL:
21243  * self.to_dtype_func(itemp, value)
21244  */
21245 
21246  /* function exit code */
21247  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21248  goto __pyx_L0;
21249  __pyx_L1_error:;
21250  __Pyx_XDECREF(__pyx_t_3);
21251  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21252  __pyx_r = 0;
21253  __pyx_L0:;
21254  __Pyx_XGIVEREF(__pyx_r);
21255  __Pyx_TraceReturn(__pyx_r, 0);
21256  __Pyx_RefNannyFinishContext();
21257  return __pyx_r;
21258 }
21259 
21260 /* "View.MemoryView":992
21261  *
21262  * @property
21263  * def base(self): # <<<<<<<<<<<<<<
21264  * return self.from_object
21265  *
21266  */
21267 
21268 /* Python wrapper */
21269 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
21270 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
21271  PyObject *__pyx_r = 0;
21272  __Pyx_RefNannyDeclarations
21273  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21274  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21275 
21276  /* function exit code */
21277  __Pyx_RefNannyFinishContext();
21278  return __pyx_r;
21279 }
21280 
21281 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21282  PyObject *__pyx_r = NULL;
21283  __Pyx_TraceDeclarations
21284  __Pyx_RefNannyDeclarations
21285  int __pyx_lineno = 0;
21286  const char *__pyx_filename = NULL;
21287  int __pyx_clineno = 0;
21288  __Pyx_RefNannySetupContext("__get__", 0);
21289  __Pyx_TraceCall("__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
21290 
21291  /* "View.MemoryView":993
21292  * @property
21293  * def base(self):
21294  * return self.from_object # <<<<<<<<<<<<<<
21295  *
21296  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
21297  */
21298  __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L1_error))
21299  __Pyx_XDECREF(__pyx_r);
21300  __Pyx_INCREF(__pyx_v_self->from_object);
21301  __pyx_r = __pyx_v_self->from_object;
21302  goto __pyx_L0;
21303 
21304  /* "View.MemoryView":992
21305  *
21306  * @property
21307  * def base(self): # <<<<<<<<<<<<<<
21308  * return self.from_object
21309  *
21310  */
21311 
21312  /* function exit code */
21313  __pyx_L1_error:;
21314  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21315  __pyx_r = NULL;
21316  __pyx_L0:;
21317  __Pyx_XGIVEREF(__pyx_r);
21318  __Pyx_TraceReturn(__pyx_r, 0);
21319  __Pyx_RefNannyFinishContext();
21320  return __pyx_r;
21321 }
21322 
21323 /* "(tree fragment)":1
21324  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
21325  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21326  * def __setstate_cython__(self, __pyx_state):
21327  */
21328 
21329 /* Python wrapper */
21330 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
21331 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
21332 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
21333  PyObject *__pyx_r = 0;
21334  __Pyx_RefNannyDeclarations
21335  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
21336  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21337 
21338  /* function exit code */
21339  __Pyx_RefNannyFinishContext();
21340  return __pyx_r;
21341 }
21342 
21343 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21344  PyObject *__pyx_r = NULL;
21345  __Pyx_TraceDeclarations
21346  __Pyx_RefNannyDeclarations
21347  PyObject *__pyx_t_1 = NULL;
21348  int __pyx_lineno = 0;
21349  const char *__pyx_filename = NULL;
21350  int __pyx_clineno = 0;
21351  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
21352  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21353 
21354  /* "(tree fragment)":2
21355  * def __reduce_cython__(self):
21356  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21357  * def __setstate_cython__(self, __pyx_state):
21358  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21359  */
21360  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
21361  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
21362  __Pyx_GOTREF(__pyx_t_1);
21363  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21364  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21365  __PYX_ERR(1, 2, __pyx_L1_error)
21366 
21367  /* "(tree fragment)":1
21368  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
21369  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21370  * def __setstate_cython__(self, __pyx_state):
21371  */
21372 
21373  /* function exit code */
21374  __pyx_L1_error:;
21375  __Pyx_XDECREF(__pyx_t_1);
21376  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21377  __pyx_r = NULL;
21378  __Pyx_XGIVEREF(__pyx_r);
21379  __Pyx_TraceReturn(__pyx_r, 0);
21380  __Pyx_RefNannyFinishContext();
21381  return __pyx_r;
21382 }
21383 
21384 /* "(tree fragment)":3
21385  * def __reduce_cython__(self):
21386  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21387  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
21388  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21389  */
21390 
21391 /* Python wrapper */
21392 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
21393 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
21394 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
21395  PyObject *__pyx_r = 0;
21396  __Pyx_RefNannyDeclarations
21397  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
21398  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
21399 
21400  /* function exit code */
21401  __Pyx_RefNannyFinishContext();
21402  return __pyx_r;
21403 }
21404 
21405 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
21406  PyObject *__pyx_r = NULL;
21407  __Pyx_TraceDeclarations
21408  __Pyx_RefNannyDeclarations
21409  PyObject *__pyx_t_1 = NULL;
21410  int __pyx_lineno = 0;
21411  const char *__pyx_filename = NULL;
21412  int __pyx_clineno = 0;
21413  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
21414  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
21415 
21416  /* "(tree fragment)":4
21417  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21418  * def __setstate_cython__(self, __pyx_state):
21419  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21420  */
21421  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
21422  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
21423  __Pyx_GOTREF(__pyx_t_1);
21424  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21425  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21426  __PYX_ERR(1, 4, __pyx_L1_error)
21427 
21428  /* "(tree fragment)":3
21429  * def __reduce_cython__(self):
21430  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21431  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
21432  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21433  */
21434 
21435  /* function exit code */
21436  __pyx_L1_error:;
21437  __Pyx_XDECREF(__pyx_t_1);
21438  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21439  __pyx_r = NULL;
21440  __Pyx_XGIVEREF(__pyx_r);
21441  __Pyx_TraceReturn(__pyx_r, 0);
21442  __Pyx_RefNannyFinishContext();
21443  return __pyx_r;
21444 }
21445 
21446 /* "View.MemoryView":999
21447  *
21448  * @cname('__pyx_memoryview_fromslice')
21449  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
21450  * int ndim,
21451  * object (*to_object_func)(char *),
21452  */
21453 
21454 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
21455  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
21456  Py_ssize_t __pyx_v_suboffset;
21457  PyObject *__pyx_v_length = NULL;
21458  PyObject *__pyx_r = NULL;
21459  __Pyx_TraceDeclarations
21460  __Pyx_RefNannyDeclarations
21461  int __pyx_t_1;
21462  PyObject *__pyx_t_2 = NULL;
21463  PyObject *__pyx_t_3 = NULL;
21464  __Pyx_TypeInfo *__pyx_t_4;
21465  Py_buffer __pyx_t_5;
21466  Py_ssize_t *__pyx_t_6;
21467  Py_ssize_t *__pyx_t_7;
21468  Py_ssize_t *__pyx_t_8;
21469  Py_ssize_t __pyx_t_9;
21470  int __pyx_lineno = 0;
21471  const char *__pyx_filename = NULL;
21472  int __pyx_clineno = 0;
21473  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
21474  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
21475 
21476  /* "View.MemoryView":1007
21477  * cdef _memoryviewslice result
21478  *
21479  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
21480  * return None
21481  *
21482  */
21483  __Pyx_TraceLine(1007,0,__PYX_ERR(1, 1007, __pyx_L1_error))
21484  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
21485  if (__pyx_t_1) {
21486 
21487  /* "View.MemoryView":1008
21488  *
21489  * if <PyObject *> memviewslice.memview == Py_None:
21490  * return None # <<<<<<<<<<<<<<
21491  *
21492  *
21493  */
21494  __Pyx_TraceLine(1008,0,__PYX_ERR(1, 1008, __pyx_L1_error))
21495  __Pyx_XDECREF(__pyx_r);
21496  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21497  goto __pyx_L0;
21498 
21499  /* "View.MemoryView":1007
21500  * cdef _memoryviewslice result
21501  *
21502  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
21503  * return None
21504  *
21505  */
21506  }
21507 
21508  /* "View.MemoryView":1013
21509  *
21510  *
21511  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
21512  *
21513  * result.from_slice = memviewslice
21514  */
21515  __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error))
21516  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
21517  __Pyx_GOTREF(__pyx_t_2);
21518  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
21519  __Pyx_GOTREF(__pyx_t_3);
21520  __Pyx_INCREF(Py_None);
21521  __Pyx_GIVEREF(Py_None);
21522  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
21523  __Pyx_INCREF(__pyx_int_0);
21524  __Pyx_GIVEREF(__pyx_int_0);
21525  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
21526  __Pyx_GIVEREF(__pyx_t_2);
21527  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
21528  __pyx_t_2 = 0;
21529  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
21530  __Pyx_GOTREF(__pyx_t_2);
21531  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21532  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
21533  __pyx_t_2 = 0;
21534 
21535  /* "View.MemoryView":1015
21536  * result = _memoryviewslice(None, 0, dtype_is_object)
21537  *
21538  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
21539  * __PYX_INC_MEMVIEW(&memviewslice, 1)
21540  *
21541  */
21542  __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
21543  __pyx_v_result->from_slice = __pyx_v_memviewslice;
21544 
21545  /* "View.MemoryView":1016
21546  *
21547  * result.from_slice = memviewslice
21548  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
21549  *
21550  * result.from_object = (<memoryview> memviewslice.memview).base
21551  */
21552  __Pyx_TraceLine(1016,0,__PYX_ERR(1, 1016, __pyx_L1_error))
21553  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
21554 
21555  /* "View.MemoryView":1018
21556  * __PYX_INC_MEMVIEW(&memviewslice, 1)
21557  *
21558  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
21559  * result.typeinfo = memviewslice.memview.typeinfo
21560  *
21561  */
21562  __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
21563  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
21564  __Pyx_GOTREF(__pyx_t_2);
21565  __Pyx_GIVEREF(__pyx_t_2);
21566  __Pyx_GOTREF(__pyx_v_result->from_object);
21567  __Pyx_DECREF(__pyx_v_result->from_object);
21568  __pyx_v_result->from_object = __pyx_t_2;
21569  __pyx_t_2 = 0;
21570 
21571  /* "View.MemoryView":1019
21572  *
21573  * result.from_object = (<memoryview> memviewslice.memview).base
21574  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
21575  *
21576  * result.view = memviewslice.memview.view
21577  */
21578  __Pyx_TraceLine(1019,0,__PYX_ERR(1, 1019, __pyx_L1_error))
21579  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
21580  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
21581 
21582  /* "View.MemoryView":1021
21583  * result.typeinfo = memviewslice.memview.typeinfo
21584  *
21585  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
21586  * result.view.buf = <void *> memviewslice.data
21587  * result.view.ndim = ndim
21588  */
21589  __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
21590  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
21591  __pyx_v_result->__pyx_base.view = __pyx_t_5;
21592 
21593  /* "View.MemoryView":1022
21594  *
21595  * result.view = memviewslice.memview.view
21596  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
21597  * result.view.ndim = ndim
21598  * (<__pyx_buffer *> &result.view).obj = Py_None
21599  */
21600  __Pyx_TraceLine(1022,0,__PYX_ERR(1, 1022, __pyx_L1_error))
21601  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
21602 
21603  /* "View.MemoryView":1023
21604  * result.view = memviewslice.memview.view
21605  * result.view.buf = <void *> memviewslice.data
21606  * result.view.ndim = ndim # <<<<<<<<<<<<<<
21607  * (<__pyx_buffer *> &result.view).obj = Py_None
21608  * Py_INCREF(Py_None)
21609  */
21610  __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
21611  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
21612 
21613  /* "View.MemoryView":1024
21614  * result.view.buf = <void *> memviewslice.data
21615  * result.view.ndim = ndim
21616  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
21617  * Py_INCREF(Py_None)
21618  *
21619  */
21620  __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
21621  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
21622 
21623  /* "View.MemoryView":1025
21624  * result.view.ndim = ndim
21625  * (<__pyx_buffer *> &result.view).obj = Py_None
21626  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
21627  *
21628  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
21629  */
21630  __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
21631  Py_INCREF(Py_None);
21632 
21633  /* "View.MemoryView":1027
21634  * Py_INCREF(Py_None)
21635  *
21636  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
21637  * result.flags = PyBUF_RECORDS
21638  * else:
21639  */
21640  __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
21641  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
21642  if (__pyx_t_1) {
21643 
21644  /* "View.MemoryView":1028
21645  *
21646  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
21647  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
21648  * else:
21649  * result.flags = PyBUF_RECORDS_RO
21650  */
21651  __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error))
21652  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
21653 
21654  /* "View.MemoryView":1027
21655  * Py_INCREF(Py_None)
21656  *
21657  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
21658  * result.flags = PyBUF_RECORDS
21659  * else:
21660  */
21661  goto __pyx_L4;
21662  }
21663 
21664  /* "View.MemoryView":1030
21665  * result.flags = PyBUF_RECORDS
21666  * else:
21667  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
21668  *
21669  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
21670  */
21671  __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
21672  /*else*/ {
21673  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
21674  }
21675  __pyx_L4:;
21676 
21677  /* "View.MemoryView":1032
21678  * result.flags = PyBUF_RECORDS_RO
21679  *
21680  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
21681  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
21682  *
21683  */
21684  __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
21685  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
21686 
21687  /* "View.MemoryView":1033
21688  *
21689  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
21690  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
21691  *
21692  *
21693  */
21694  __Pyx_TraceLine(1033,0,__PYX_ERR(1, 1033, __pyx_L1_error))
21695  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
21696 
21697  /* "View.MemoryView":1036
21698  *
21699  *
21700  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
21701  * for suboffset in result.from_slice.suboffsets[:ndim]:
21702  * if suboffset >= 0:
21703  */
21704  __Pyx_TraceLine(1036,0,__PYX_ERR(1, 1036, __pyx_L1_error))
21705  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
21706 
21707  /* "View.MemoryView":1037
21708  *
21709  * result.view.suboffsets = NULL
21710  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
21711  * if suboffset >= 0:
21712  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21713  */
21714  __Pyx_TraceLine(1037,0,__PYX_ERR(1, 1037, __pyx_L1_error))
21715  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
21716  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21717  __pyx_t_6 = __pyx_t_8;
21718  __pyx_v_suboffset = (__pyx_t_6[0]);
21719 
21720  /* "View.MemoryView":1038
21721  * result.view.suboffsets = NULL
21722  * for suboffset in result.from_slice.suboffsets[:ndim]:
21723  * if suboffset >= 0: # <<<<<<<<<<<<<<
21724  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21725  * break
21726  */
21727  __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
21728  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
21729  if (__pyx_t_1) {
21730 
21731  /* "View.MemoryView":1039
21732  * for suboffset in result.from_slice.suboffsets[:ndim]:
21733  * if suboffset >= 0:
21734  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
21735  * break
21736  *
21737  */
21738  __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
21739  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
21740 
21741  /* "View.MemoryView":1040
21742  * if suboffset >= 0:
21743  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21744  * break # <<<<<<<<<<<<<<
21745  *
21746  * result.view.len = result.view.itemsize
21747  */
21748  __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
21749  goto __pyx_L6_break;
21750 
21751  /* "View.MemoryView":1038
21752  * result.view.suboffsets = NULL
21753  * for suboffset in result.from_slice.suboffsets[:ndim]:
21754  * if suboffset >= 0: # <<<<<<<<<<<<<<
21755  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21756  * break
21757  */
21758  }
21759  }
21760  __pyx_L6_break:;
21761 
21762  /* "View.MemoryView":1042
21763  * break
21764  *
21765  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
21766  * for length in result.view.shape[:ndim]:
21767  * result.view.len *= length
21768  */
21769  __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
21770  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
21771  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
21772 
21773  /* "View.MemoryView":1043
21774  *
21775  * result.view.len = result.view.itemsize
21776  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
21777  * result.view.len *= length
21778  *
21779  */
21780  __Pyx_TraceLine(1043,0,__PYX_ERR(1, 1043, __pyx_L1_error))
21781  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
21782  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21783  __pyx_t_6 = __pyx_t_8;
21784  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
21785  __Pyx_GOTREF(__pyx_t_2);
21786  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
21787  __pyx_t_2 = 0;
21788 
21789  /* "View.MemoryView":1044
21790  * result.view.len = result.view.itemsize
21791  * for length in result.view.shape[:ndim]:
21792  * result.view.len *= length # <<<<<<<<<<<<<<
21793  *
21794  * result.to_object_func = to_object_func
21795  */
21796  __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
21797  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
21798  __Pyx_GOTREF(__pyx_t_2);
21799  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
21800  __Pyx_GOTREF(__pyx_t_3);
21801  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21802  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
21803  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21804  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
21805  }
21806 
21807  /* "View.MemoryView":1046
21808  * result.view.len *= length
21809  *
21810  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
21811  * result.to_dtype_func = to_dtype_func
21812  *
21813  */
21814  __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
21815  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
21816 
21817  /* "View.MemoryView":1047
21818  *
21819  * result.to_object_func = to_object_func
21820  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
21821  *
21822  * return result
21823  */
21824  __Pyx_TraceLine(1047,0,__PYX_ERR(1, 1047, __pyx_L1_error))
21825  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
21826 
21827  /* "View.MemoryView":1049
21828  * result.to_dtype_func = to_dtype_func
21829  *
21830  * return result # <<<<<<<<<<<<<<
21831  *
21832  * @cname('__pyx_memoryview_get_slice_from_memoryview')
21833  */
21834  __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
21835  __Pyx_XDECREF(__pyx_r);
21836  __Pyx_INCREF(((PyObject *)__pyx_v_result));
21837  __pyx_r = ((PyObject *)__pyx_v_result);
21838  goto __pyx_L0;
21839 
21840  /* "View.MemoryView":999
21841  *
21842  * @cname('__pyx_memoryview_fromslice')
21843  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
21844  * int ndim,
21845  * object (*to_object_func)(char *),
21846  */
21847 
21848  /* function exit code */
21849  __pyx_L1_error:;
21850  __Pyx_XDECREF(__pyx_t_2);
21851  __Pyx_XDECREF(__pyx_t_3);
21852  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21853  __pyx_r = 0;
21854  __pyx_L0:;
21855  __Pyx_XDECREF((PyObject *)__pyx_v_result);
21856  __Pyx_XDECREF(__pyx_v_length);
21857  __Pyx_XGIVEREF(__pyx_r);
21858  __Pyx_TraceReturn(__pyx_r, 0);
21859  __Pyx_RefNannyFinishContext();
21860  return __pyx_r;
21861 }
21862 
21863 /* "View.MemoryView":1052
21864  *
21865  * @cname('__pyx_memoryview_get_slice_from_memoryview')
21866  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
21867  * __Pyx_memviewslice *mslice) except NULL:
21868  * cdef _memoryviewslice obj
21869  */
21870 
21871 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
21872  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
21873  __Pyx_memviewslice *__pyx_r;
21874  __Pyx_TraceDeclarations
21875  __Pyx_RefNannyDeclarations
21876  int __pyx_t_1;
21877  int __pyx_t_2;
21878  PyObject *__pyx_t_3 = NULL;
21879  int __pyx_lineno = 0;
21880  const char *__pyx_filename = NULL;
21881  int __pyx_clineno = 0;
21882  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
21883  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
21884 
21885  /* "View.MemoryView":1055
21886  * __Pyx_memviewslice *mslice) except NULL:
21887  * cdef _memoryviewslice obj
21888  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
21889  * obj = memview
21890  * return &obj.from_slice
21891  */
21892  __Pyx_TraceLine(1055,0,__PYX_ERR(1, 1055, __pyx_L1_error))
21893  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
21894  __pyx_t_2 = (__pyx_t_1 != 0);
21895  if (__pyx_t_2) {
21896 
21897  /* "View.MemoryView":1056
21898  * cdef _memoryviewslice obj
21899  * if isinstance(memview, _memoryviewslice):
21900  * obj = memview # <<<<<<<<<<<<<<
21901  * return &obj.from_slice
21902  * else:
21903  */
21904  __Pyx_TraceLine(1056,0,__PYX_ERR(1, 1056, __pyx_L1_error))
21905  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
21906  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
21907  __Pyx_INCREF(__pyx_t_3);
21908  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
21909  __pyx_t_3 = 0;
21910 
21911  /* "View.MemoryView":1057
21912  * if isinstance(memview, _memoryviewslice):
21913  * obj = memview
21914  * return &obj.from_slice # <<<<<<<<<<<<<<
21915  * else:
21916  * slice_copy(memview, mslice)
21917  */
21918  __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
21919  __pyx_r = (&__pyx_v_obj->from_slice);
21920  goto __pyx_L0;
21921 
21922  /* "View.MemoryView":1055
21923  * __Pyx_memviewslice *mslice) except NULL:
21924  * cdef _memoryviewslice obj
21925  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
21926  * obj = memview
21927  * return &obj.from_slice
21928  */
21929  }
21930 
21931  /* "View.MemoryView":1059
21932  * return &obj.from_slice
21933  * else:
21934  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
21935  * return mslice
21936  *
21937  */
21938  __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
21939  /*else*/ {
21940  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
21941 
21942  /* "View.MemoryView":1060
21943  * else:
21944  * slice_copy(memview, mslice)
21945  * return mslice # <<<<<<<<<<<<<<
21946  *
21947  * @cname('__pyx_memoryview_slice_copy')
21948  */
21949  __Pyx_TraceLine(1060,0,__PYX_ERR(1, 1060, __pyx_L1_error))
21950  __pyx_r = __pyx_v_mslice;
21951  goto __pyx_L0;
21952  }
21953 
21954  /* "View.MemoryView":1052
21955  *
21956  * @cname('__pyx_memoryview_get_slice_from_memoryview')
21957  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
21958  * __Pyx_memviewslice *mslice) except NULL:
21959  * cdef _memoryviewslice obj
21960  */
21961 
21962  /* function exit code */
21963  __pyx_L1_error:;
21964  __Pyx_XDECREF(__pyx_t_3);
21965  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
21966  __pyx_r = NULL;
21967  __pyx_L0:;
21968  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
21969  __Pyx_TraceReturn(Py_None, 0);
21970  __Pyx_RefNannyFinishContext();
21971  return __pyx_r;
21972 }
21973 
21974 /* "View.MemoryView":1063
21975  *
21976  * @cname('__pyx_memoryview_slice_copy')
21977  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
21978  * cdef int dim
21979  * cdef (Py_ssize_t*) shape, strides, suboffsets
21980  */
21981 
21982 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
21983  int __pyx_v_dim;
21984  Py_ssize_t *__pyx_v_shape;
21985  Py_ssize_t *__pyx_v_strides;
21986  Py_ssize_t *__pyx_v_suboffsets;
21987  __Pyx_TraceDeclarations
21988  __Pyx_RefNannyDeclarations
21989  Py_ssize_t *__pyx_t_1;
21990  int __pyx_t_2;
21991  int __pyx_t_3;
21992  int __pyx_t_4;
21993  Py_ssize_t __pyx_t_5;
21994  int __pyx_lineno = 0;
21995  const char *__pyx_filename = NULL;
21996  int __pyx_clineno = 0;
21997  __Pyx_RefNannySetupContext("slice_copy", 0);
21998  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
21999 
22000  /* "View.MemoryView":1067
22001  * cdef (Py_ssize_t*) shape, strides, suboffsets
22002  *
22003  * shape = memview.view.shape # <<<<<<<<<<<<<<
22004  * strides = memview.view.strides
22005  * suboffsets = memview.view.suboffsets
22006  */
22007  __Pyx_TraceLine(1067,0,__PYX_ERR(1, 1067, __pyx_L1_error))
22008  __pyx_t_1 = __pyx_v_memview->view.shape;
22009  __pyx_v_shape = __pyx_t_1;
22010 
22011  /* "View.MemoryView":1068
22012  *
22013  * shape = memview.view.shape
22014  * strides = memview.view.strides # <<<<<<<<<<<<<<
22015  * suboffsets = memview.view.suboffsets
22016  *
22017  */
22018  __Pyx_TraceLine(1068,0,__PYX_ERR(1, 1068, __pyx_L1_error))
22019  __pyx_t_1 = __pyx_v_memview->view.strides;
22020  __pyx_v_strides = __pyx_t_1;
22021 
22022  /* "View.MemoryView":1069
22023  * shape = memview.view.shape
22024  * strides = memview.view.strides
22025  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
22026  *
22027  * dst.memview = <__pyx_memoryview *> memview
22028  */
22029  __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
22030  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
22031  __pyx_v_suboffsets = __pyx_t_1;
22032 
22033  /* "View.MemoryView":1071
22034  * suboffsets = memview.view.suboffsets
22035  *
22036  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
22037  * dst.data = <char *> memview.view.buf
22038  *
22039  */
22040  __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
22041  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
22042 
22043  /* "View.MemoryView":1072
22044  *
22045  * dst.memview = <__pyx_memoryview *> memview
22046  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
22047  *
22048  * for dim in range(memview.view.ndim):
22049  */
22050  __Pyx_TraceLine(1072,0,__PYX_ERR(1, 1072, __pyx_L1_error))
22051  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
22052 
22053  /* "View.MemoryView":1074
22054  * dst.data = <char *> memview.view.buf
22055  *
22056  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
22057  * dst.shape[dim] = shape[dim]
22058  * dst.strides[dim] = strides[dim]
22059  */
22060  __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
22061  __pyx_t_2 = __pyx_v_memview->view.ndim;
22062  __pyx_t_3 = __pyx_t_2;
22063  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22064  __pyx_v_dim = __pyx_t_4;
22065 
22066  /* "View.MemoryView":1075
22067  *
22068  * for dim in range(memview.view.ndim):
22069  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
22070  * dst.strides[dim] = strides[dim]
22071  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
22072  */
22073  __Pyx_TraceLine(1075,0,__PYX_ERR(1, 1075, __pyx_L1_error))
22074  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
22075 
22076  /* "View.MemoryView":1076
22077  * for dim in range(memview.view.ndim):
22078  * dst.shape[dim] = shape[dim]
22079  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
22080  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
22081  *
22082  */
22083  __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
22084  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
22085 
22086  /* "View.MemoryView":1077
22087  * dst.shape[dim] = shape[dim]
22088  * dst.strides[dim] = strides[dim]
22089  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
22090  *
22091  * @cname('__pyx_memoryview_copy_object')
22092  */
22093  __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
22094  if ((__pyx_v_suboffsets != 0)) {
22095  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
22096  } else {
22097  __pyx_t_5 = -1L;
22098  }
22099  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
22100  }
22101 
22102  /* "View.MemoryView":1063
22103  *
22104  * @cname('__pyx_memoryview_slice_copy')
22105  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
22106  * cdef int dim
22107  * cdef (Py_ssize_t*) shape, strides, suboffsets
22108  */
22109 
22110  /* function exit code */
22111  goto __pyx_L0;
22112  __pyx_L1_error:;
22113  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
22114  __pyx_L0:;
22115  __Pyx_TraceReturn(Py_None, 0);
22116  __Pyx_RefNannyFinishContext();
22117 }
22118 
22119 /* "View.MemoryView":1080
22120  *
22121  * @cname('__pyx_memoryview_copy_object')
22122  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
22123  * "Create a new memoryview object"
22124  * cdef __Pyx_memviewslice memviewslice
22125  */
22126 
22127 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
22128  __Pyx_memviewslice __pyx_v_memviewslice;
22129  PyObject *__pyx_r = NULL;
22130  __Pyx_TraceDeclarations
22131  __Pyx_RefNannyDeclarations
22132  PyObject *__pyx_t_1 = NULL;
22133  int __pyx_lineno = 0;
22134  const char *__pyx_filename = NULL;
22135  int __pyx_clineno = 0;
22136  __Pyx_RefNannySetupContext("memoryview_copy", 0);
22137  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
22138 
22139  /* "View.MemoryView":1083
22140  * "Create a new memoryview object"
22141  * cdef __Pyx_memviewslice memviewslice
22142  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
22143  * return memoryview_copy_from_slice(memview, &memviewslice)
22144  *
22145  */
22146  __Pyx_TraceLine(1083,0,__PYX_ERR(1, 1083, __pyx_L1_error))
22147  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
22148 
22149  /* "View.MemoryView":1084
22150  * cdef __Pyx_memviewslice memviewslice
22151  * slice_copy(memview, &memviewslice)
22152  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
22153  *
22154  * @cname('__pyx_memoryview_copy_object_from_slice')
22155  */
22156  __Pyx_TraceLine(1084,0,__PYX_ERR(1, 1084, __pyx_L1_error))
22157  __Pyx_XDECREF(__pyx_r);
22158  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
22159  __Pyx_GOTREF(__pyx_t_1);
22160  __pyx_r = __pyx_t_1;
22161  __pyx_t_1 = 0;
22162  goto __pyx_L0;
22163 
22164  /* "View.MemoryView":1080
22165  *
22166  * @cname('__pyx_memoryview_copy_object')
22167  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
22168  * "Create a new memoryview object"
22169  * cdef __Pyx_memviewslice memviewslice
22170  */
22171 
22172  /* function exit code */
22173  __pyx_L1_error:;
22174  __Pyx_XDECREF(__pyx_t_1);
22175  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
22176  __pyx_r = 0;
22177  __pyx_L0:;
22178  __Pyx_XGIVEREF(__pyx_r);
22179  __Pyx_TraceReturn(__pyx_r, 0);
22180  __Pyx_RefNannyFinishContext();
22181  return __pyx_r;
22182 }
22183 
22184 /* "View.MemoryView":1087
22185  *
22186  * @cname('__pyx_memoryview_copy_object_from_slice')
22187  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
22188  * """
22189  * Create a new memoryview object from a given memoryview object and slice.
22190  */
22191 
22192 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
22193  PyObject *(*__pyx_v_to_object_func)(char *);
22194  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
22195  PyObject *__pyx_r = NULL;
22196  __Pyx_TraceDeclarations
22197  __Pyx_RefNannyDeclarations
22198  int __pyx_t_1;
22199  int __pyx_t_2;
22200  PyObject *(*__pyx_t_3)(char *);
22201  int (*__pyx_t_4)(char *, PyObject *);
22202  PyObject *__pyx_t_5 = NULL;
22203  int __pyx_lineno = 0;
22204  const char *__pyx_filename = NULL;
22205  int __pyx_clineno = 0;
22206  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
22207  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
22208 
22209  /* "View.MemoryView":1094
22210  * cdef int (*to_dtype_func)(char *, object) except 0
22211  *
22212  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
22213  * to_object_func = (<_memoryviewslice> memview).to_object_func
22214  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22215  */
22216  __Pyx_TraceLine(1094,0,__PYX_ERR(1, 1094, __pyx_L1_error))
22217  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22218  __pyx_t_2 = (__pyx_t_1 != 0);
22219  if (__pyx_t_2) {
22220 
22221  /* "View.MemoryView":1095
22222  *
22223  * if isinstance(memview, _memoryviewslice):
22224  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
22225  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22226  * else:
22227  */
22228  __Pyx_TraceLine(1095,0,__PYX_ERR(1, 1095, __pyx_L1_error))
22229  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
22230  __pyx_v_to_object_func = __pyx_t_3;
22231 
22232  /* "View.MemoryView":1096
22233  * if isinstance(memview, _memoryviewslice):
22234  * to_object_func = (<_memoryviewslice> memview).to_object_func
22235  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
22236  * else:
22237  * to_object_func = NULL
22238  */
22239  __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
22240  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
22241  __pyx_v_to_dtype_func = __pyx_t_4;
22242 
22243  /* "View.MemoryView":1094
22244  * cdef int (*to_dtype_func)(char *, object) except 0
22245  *
22246  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
22247  * to_object_func = (<_memoryviewslice> memview).to_object_func
22248  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22249  */
22250  goto __pyx_L3;
22251  }
22252 
22253  /* "View.MemoryView":1098
22254  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22255  * else:
22256  * to_object_func = NULL # <<<<<<<<<<<<<<
22257  * to_dtype_func = NULL
22258  *
22259  */
22260  __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
22261  /*else*/ {
22262  __pyx_v_to_object_func = NULL;
22263 
22264  /* "View.MemoryView":1099
22265  * else:
22266  * to_object_func = NULL
22267  * to_dtype_func = NULL # <<<<<<<<<<<<<<
22268  *
22269  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
22270  */
22271  __Pyx_TraceLine(1099,0,__PYX_ERR(1, 1099, __pyx_L1_error))
22272  __pyx_v_to_dtype_func = NULL;
22273  }
22274  __pyx_L3:;
22275 
22276  /* "View.MemoryView":1101
22277  * to_dtype_func = NULL
22278  *
22279  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
22280  * to_object_func, to_dtype_func,
22281  * memview.dtype_is_object)
22282  */
22283  __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
22284  __Pyx_XDECREF(__pyx_r);
22285 
22286  /* "View.MemoryView":1103
22287  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
22288  * to_object_func, to_dtype_func,
22289  * memview.dtype_is_object) # <<<<<<<<<<<<<<
22290  *
22291  *
22292  */
22293  __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
22294  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
22295  __Pyx_GOTREF(__pyx_t_5);
22296  __pyx_r = __pyx_t_5;
22297  __pyx_t_5 = 0;
22298  goto __pyx_L0;
22299 
22300  /* "View.MemoryView":1087
22301  *
22302  * @cname('__pyx_memoryview_copy_object_from_slice')
22303  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
22304  * """
22305  * Create a new memoryview object from a given memoryview object and slice.
22306  */
22307 
22308  /* function exit code */
22309  __pyx_L1_error:;
22310  __Pyx_XDECREF(__pyx_t_5);
22311  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22312  __pyx_r = 0;
22313  __pyx_L0:;
22314  __Pyx_XGIVEREF(__pyx_r);
22315  __Pyx_TraceReturn(__pyx_r, 0);
22316  __Pyx_RefNannyFinishContext();
22317  return __pyx_r;
22318 }
22319 
22320 /* "View.MemoryView":1109
22321  *
22322  *
22323  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
22324  * if arg < 0:
22325  * return -arg
22326  */
22327 
22328 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
22329  Py_ssize_t __pyx_r;
22330  __Pyx_TraceDeclarations
22331  int __pyx_t_1;
22332  int __pyx_lineno = 0;
22333  const char *__pyx_filename = NULL;
22334  int __pyx_clineno = 0;
22335  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
22336 
22337  /* "View.MemoryView":1110
22338  *
22339  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22340  * if arg < 0: # <<<<<<<<<<<<<<
22341  * return -arg
22342  * else:
22343  */
22344  __Pyx_TraceLine(1110,1,__PYX_ERR(1, 1110, __pyx_L1_error))
22345  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
22346  if (__pyx_t_1) {
22347 
22348  /* "View.MemoryView":1111
22349  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22350  * if arg < 0:
22351  * return -arg # <<<<<<<<<<<<<<
22352  * else:
22353  * return arg
22354  */
22355  __Pyx_TraceLine(1111,1,__PYX_ERR(1, 1111, __pyx_L1_error))
22356  __pyx_r = (-__pyx_v_arg);
22357  goto __pyx_L0;
22358 
22359  /* "View.MemoryView":1110
22360  *
22361  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22362  * if arg < 0: # <<<<<<<<<<<<<<
22363  * return -arg
22364  * else:
22365  */
22366  }
22367 
22368  /* "View.MemoryView":1113
22369  * return -arg
22370  * else:
22371  * return arg # <<<<<<<<<<<<<<
22372  *
22373  * @cname('__pyx_get_best_slice_order')
22374  */
22375  __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
22376  /*else*/ {
22377  __pyx_r = __pyx_v_arg;
22378  goto __pyx_L0;
22379  }
22380 
22381  /* "View.MemoryView":1109
22382  *
22383  *
22384  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
22385  * if arg < 0:
22386  * return -arg
22387  */
22388 
22389  /* function exit code */
22390  __pyx_L1_error:;
22391  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22392  __pyx_r = 0;
22393  __pyx_L0:;
22394  __Pyx_TraceReturn(Py_None, 1);
22395  return __pyx_r;
22396 }
22397 
22398 /* "View.MemoryView":1116
22399  *
22400  * @cname('__pyx_get_best_slice_order')
22401  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
22402  * """
22403  * Figure out the best memory access order for a given slice.
22404  */
22405 
22406 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
22407  int __pyx_v_i;
22408  Py_ssize_t __pyx_v_c_stride;
22409  Py_ssize_t __pyx_v_f_stride;
22410  char __pyx_r;
22411  __Pyx_TraceDeclarations
22412  int __pyx_t_1;
22413  int __pyx_t_2;
22414  int __pyx_t_3;
22415  int __pyx_t_4;
22416  int __pyx_lineno = 0;
22417  const char *__pyx_filename = NULL;
22418  int __pyx_clineno = 0;
22419  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
22420 
22421  /* "View.MemoryView":1121
22422  * """
22423  * cdef int i
22424  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
22425  * cdef Py_ssize_t f_stride = 0
22426  *
22427  */
22428  __Pyx_TraceLine(1121,1,__PYX_ERR(1, 1121, __pyx_L1_error))
22429  __pyx_v_c_stride = 0;
22430 
22431  /* "View.MemoryView":1122
22432  * cdef int i
22433  * cdef Py_ssize_t c_stride = 0
22434  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
22435  *
22436  * for i in range(ndim - 1, -1, -1):
22437  */
22438  __Pyx_TraceLine(1122,1,__PYX_ERR(1, 1122, __pyx_L1_error))
22439  __pyx_v_f_stride = 0;
22440 
22441  /* "View.MemoryView":1124
22442  * cdef Py_ssize_t f_stride = 0
22443  *
22444  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
22445  * if mslice.shape[i] > 1:
22446  * c_stride = mslice.strides[i]
22447  */
22448  __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
22449  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
22450  __pyx_v_i = __pyx_t_1;
22451 
22452  /* "View.MemoryView":1125
22453  *
22454  * for i in range(ndim - 1, -1, -1):
22455  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22456  * c_stride = mslice.strides[i]
22457  * break
22458  */
22459  __Pyx_TraceLine(1125,1,__PYX_ERR(1, 1125, __pyx_L1_error))
22460  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22461  if (__pyx_t_2) {
22462 
22463  /* "View.MemoryView":1126
22464  * for i in range(ndim - 1, -1, -1):
22465  * if mslice.shape[i] > 1:
22466  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
22467  * break
22468  *
22469  */
22470  __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
22471  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22472 
22473  /* "View.MemoryView":1127
22474  * if mslice.shape[i] > 1:
22475  * c_stride = mslice.strides[i]
22476  * break # <<<<<<<<<<<<<<
22477  *
22478  * for i in range(ndim):
22479  */
22480  __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
22481  goto __pyx_L4_break;
22482 
22483  /* "View.MemoryView":1125
22484  *
22485  * for i in range(ndim - 1, -1, -1):
22486  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22487  * c_stride = mslice.strides[i]
22488  * break
22489  */
22490  }
22491  }
22492  __pyx_L4_break:;
22493 
22494  /* "View.MemoryView":1129
22495  * break
22496  *
22497  * for i in range(ndim): # <<<<<<<<<<<<<<
22498  * if mslice.shape[i] > 1:
22499  * f_stride = mslice.strides[i]
22500  */
22501  __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
22502  __pyx_t_1 = __pyx_v_ndim;
22503  __pyx_t_3 = __pyx_t_1;
22504  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22505  __pyx_v_i = __pyx_t_4;
22506 
22507  /* "View.MemoryView":1130
22508  *
22509  * for i in range(ndim):
22510  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22511  * f_stride = mslice.strides[i]
22512  * break
22513  */
22514  __Pyx_TraceLine(1130,1,__PYX_ERR(1, 1130, __pyx_L1_error))
22515  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22516  if (__pyx_t_2) {
22517 
22518  /* "View.MemoryView":1131
22519  * for i in range(ndim):
22520  * if mslice.shape[i] > 1:
22521  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
22522  * break
22523  *
22524  */
22525  __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
22526  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22527 
22528  /* "View.MemoryView":1132
22529  * if mslice.shape[i] > 1:
22530  * f_stride = mslice.strides[i]
22531  * break # <<<<<<<<<<<<<<
22532  *
22533  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
22534  */
22535  __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
22536  goto __pyx_L7_break;
22537 
22538  /* "View.MemoryView":1130
22539  *
22540  * for i in range(ndim):
22541  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
22542  * f_stride = mslice.strides[i]
22543  * break
22544  */
22545  }
22546  }
22547  __pyx_L7_break:;
22548 
22549  /* "View.MemoryView":1134
22550  * break
22551  *
22552  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
22553  * return 'C'
22554  * else:
22555  */
22556  __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
22557  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
22558  if (__pyx_t_2) {
22559 
22560  /* "View.MemoryView":1135
22561  *
22562  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
22563  * return 'C' # <<<<<<<<<<<<<<
22564  * else:
22565  * return 'F'
22566  */
22567  __Pyx_TraceLine(1135,1,__PYX_ERR(1, 1135, __pyx_L1_error))
22568  __pyx_r = 'C';
22569  goto __pyx_L0;
22570 
22571  /* "View.MemoryView":1134
22572  * break
22573  *
22574  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
22575  * return 'C'
22576  * else:
22577  */
22578  }
22579 
22580  /* "View.MemoryView":1137
22581  * return 'C'
22582  * else:
22583  * return 'F' # <<<<<<<<<<<<<<
22584  *
22585  * @cython.cdivision(True)
22586  */
22587  __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
22588  /*else*/ {
22589  __pyx_r = 'F';
22590  goto __pyx_L0;
22591  }
22592 
22593  /* "View.MemoryView":1116
22594  *
22595  * @cname('__pyx_get_best_slice_order')
22596  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
22597  * """
22598  * Figure out the best memory access order for a given slice.
22599  */
22600 
22601  /* function exit code */
22602  __pyx_L1_error:;
22603  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22604  __pyx_r = 0;
22605  __pyx_L0:;
22606  __Pyx_TraceReturn(Py_None, 1);
22607  return __pyx_r;
22608 }
22609 
22610 /* "View.MemoryView":1140
22611  *
22612  * @cython.cdivision(True)
22613  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
22614  * char *dst_data, Py_ssize_t *dst_strides,
22615  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
22616  */
22617 
22618 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
22619  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
22620  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
22621  Py_ssize_t __pyx_v_dst_extent;
22622  Py_ssize_t __pyx_v_src_stride;
22623  Py_ssize_t __pyx_v_dst_stride;
22624  int __pyx_t_1;
22625  int __pyx_t_2;
22626  int __pyx_t_3;
22627  Py_ssize_t __pyx_t_4;
22628  Py_ssize_t __pyx_t_5;
22629  Py_ssize_t __pyx_t_6;
22630 
22631  /* "View.MemoryView":1147
22632  *
22633  * cdef Py_ssize_t i
22634  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
22635  * cdef Py_ssize_t dst_extent = dst_shape[0]
22636  * cdef Py_ssize_t src_stride = src_strides[0]
22637  */
22638  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
22639 
22640  /* "View.MemoryView":1148
22641  * cdef Py_ssize_t i
22642  * cdef Py_ssize_t src_extent = src_shape[0]
22643  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
22644  * cdef Py_ssize_t src_stride = src_strides[0]
22645  * cdef Py_ssize_t dst_stride = dst_strides[0]
22646  */
22647  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
22648 
22649  /* "View.MemoryView":1149
22650  * cdef Py_ssize_t src_extent = src_shape[0]
22651  * cdef Py_ssize_t dst_extent = dst_shape[0]
22652  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
22653  * cdef Py_ssize_t dst_stride = dst_strides[0]
22654  *
22655  */
22656  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
22657 
22658  /* "View.MemoryView":1150
22659  * cdef Py_ssize_t dst_extent = dst_shape[0]
22660  * cdef Py_ssize_t src_stride = src_strides[0]
22661  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
22662  *
22663  * if ndim == 1:
22664  */
22665  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
22666 
22667  /* "View.MemoryView":1152
22668  * cdef Py_ssize_t dst_stride = dst_strides[0]
22669  *
22670  * if ndim == 1: # <<<<<<<<<<<<<<
22671  * if (src_stride > 0 and dst_stride > 0 and
22672  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22673  */
22674  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
22675  if (__pyx_t_1) {
22676 
22677  /* "View.MemoryView":1153
22678  *
22679  * if ndim == 1:
22680  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
22681  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22682  * memcpy(dst_data, src_data, itemsize * dst_extent)
22683  */
22684  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
22685  if (__pyx_t_2) {
22686  } else {
22687  __pyx_t_1 = __pyx_t_2;
22688  goto __pyx_L5_bool_binop_done;
22689  }
22690  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
22691  if (__pyx_t_2) {
22692  } else {
22693  __pyx_t_1 = __pyx_t_2;
22694  goto __pyx_L5_bool_binop_done;
22695  }
22696 
22697  /* "View.MemoryView":1154
22698  * if ndim == 1:
22699  * if (src_stride > 0 and dst_stride > 0 and
22700  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
22701  * memcpy(dst_data, src_data, itemsize * dst_extent)
22702  * else:
22703  */
22704  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
22705  if (__pyx_t_2) {
22706  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
22707  }
22708  __pyx_t_3 = (__pyx_t_2 != 0);
22709  __pyx_t_1 = __pyx_t_3;
22710  __pyx_L5_bool_binop_done:;
22711 
22712  /* "View.MemoryView":1153
22713  *
22714  * if ndim == 1:
22715  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
22716  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22717  * memcpy(dst_data, src_data, itemsize * dst_extent)
22718  */
22719  if (__pyx_t_1) {
22720 
22721  /* "View.MemoryView":1155
22722  * if (src_stride > 0 and dst_stride > 0 and
22723  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22724  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
22725  * else:
22726  * for i in range(dst_extent):
22727  */
22728  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
22729 
22730  /* "View.MemoryView":1153
22731  *
22732  * if ndim == 1:
22733  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
22734  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22735  * memcpy(dst_data, src_data, itemsize * dst_extent)
22736  */
22737  goto __pyx_L4;
22738  }
22739 
22740  /* "View.MemoryView":1157
22741  * memcpy(dst_data, src_data, itemsize * dst_extent)
22742  * else:
22743  * for i in range(dst_extent): # <<<<<<<<<<<<<<
22744  * memcpy(dst_data, src_data, itemsize)
22745  * src_data += src_stride
22746  */
22747  /*else*/ {
22748  __pyx_t_4 = __pyx_v_dst_extent;
22749  __pyx_t_5 = __pyx_t_4;
22750  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22751  __pyx_v_i = __pyx_t_6;
22752 
22753  /* "View.MemoryView":1158
22754  * else:
22755  * for i in range(dst_extent):
22756  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
22757  * src_data += src_stride
22758  * dst_data += dst_stride
22759  */
22760  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
22761 
22762  /* "View.MemoryView":1159
22763  * for i in range(dst_extent):
22764  * memcpy(dst_data, src_data, itemsize)
22765  * src_data += src_stride # <<<<<<<<<<<<<<
22766  * dst_data += dst_stride
22767  * else:
22768  */
22769  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
22770 
22771  /* "View.MemoryView":1160
22772  * memcpy(dst_data, src_data, itemsize)
22773  * src_data += src_stride
22774  * dst_data += dst_stride # <<<<<<<<<<<<<<
22775  * else:
22776  * for i in range(dst_extent):
22777  */
22778  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
22779  }
22780  }
22781  __pyx_L4:;
22782 
22783  /* "View.MemoryView":1152
22784  * cdef Py_ssize_t dst_stride = dst_strides[0]
22785  *
22786  * if ndim == 1: # <<<<<<<<<<<<<<
22787  * if (src_stride > 0 and dst_stride > 0 and
22788  * <size_t> src_stride == itemsize == <size_t> dst_stride):
22789  */
22790  goto __pyx_L3;
22791  }
22792 
22793  /* "View.MemoryView":1162
22794  * dst_data += dst_stride
22795  * else:
22796  * for i in range(dst_extent): # <<<<<<<<<<<<<<
22797  * _copy_strided_to_strided(src_data, src_strides + 1,
22798  * dst_data, dst_strides + 1,
22799  */
22800  /*else*/ {
22801  __pyx_t_4 = __pyx_v_dst_extent;
22802  __pyx_t_5 = __pyx_t_4;
22803  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22804  __pyx_v_i = __pyx_t_6;
22805 
22806  /* "View.MemoryView":1163
22807  * else:
22808  * for i in range(dst_extent):
22809  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
22810  * dst_data, dst_strides + 1,
22811  * src_shape + 1, dst_shape + 1,
22812  */
22813  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
22814 
22815  /* "View.MemoryView":1167
22816  * src_shape + 1, dst_shape + 1,
22817  * ndim - 1, itemsize)
22818  * src_data += src_stride # <<<<<<<<<<<<<<
22819  * dst_data += dst_stride
22820  *
22821  */
22822  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
22823 
22824  /* "View.MemoryView":1168
22825  * ndim - 1, itemsize)
22826  * src_data += src_stride
22827  * dst_data += dst_stride # <<<<<<<<<<<<<<
22828  *
22829  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
22830  */
22831  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
22832  }
22833  }
22834  __pyx_L3:;
22835 
22836  /* "View.MemoryView":1140
22837  *
22838  * @cython.cdivision(True)
22839  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
22840  * char *dst_data, Py_ssize_t *dst_strides,
22841  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
22842  */
22843 
22844  /* function exit code */
22845 }
22846 
22847 /* "View.MemoryView":1170
22848  * dst_data += dst_stride
22849  *
22850  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
22851  * __Pyx_memviewslice *dst,
22852  * int ndim, size_t itemsize) nogil:
22853  */
22854 
22855 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
22856  __Pyx_TraceDeclarations
22857  int __pyx_lineno = 0;
22858  const char *__pyx_filename = NULL;
22859  int __pyx_clineno = 0;
22860  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
22861 
22862  /* "View.MemoryView":1173
22863  * __Pyx_memviewslice *dst,
22864  * int ndim, size_t itemsize) nogil:
22865  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
22866  * src.shape, dst.shape, ndim, itemsize)
22867  *
22868  */
22869  __Pyx_TraceLine(1173,1,__PYX_ERR(1, 1173, __pyx_L1_error))
22870  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
22871 
22872  /* "View.MemoryView":1170
22873  * dst_data += dst_stride
22874  *
22875  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
22876  * __Pyx_memviewslice *dst,
22877  * int ndim, size_t itemsize) nogil:
22878  */
22879 
22880  /* function exit code */
22881  goto __pyx_L0;
22882  __pyx_L1_error:;
22883  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22884  __pyx_L0:;
22885  __Pyx_TraceReturn(Py_None, 1);
22886 }
22887 
22888 /* "View.MemoryView":1177
22889  *
22890  * @cname('__pyx_memoryview_slice_get_size')
22891  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
22892  * "Return the size of the memory occupied by the slice in number of bytes"
22893  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
22894  */
22895 
22896 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
22897  Py_ssize_t __pyx_v_shape;
22898  Py_ssize_t __pyx_v_size;
22899  Py_ssize_t __pyx_r;
22900  __Pyx_TraceDeclarations
22901  Py_ssize_t __pyx_t_1;
22902  Py_ssize_t *__pyx_t_2;
22903  Py_ssize_t *__pyx_t_3;
22904  Py_ssize_t *__pyx_t_4;
22905  int __pyx_lineno = 0;
22906  const char *__pyx_filename = NULL;
22907  int __pyx_clineno = 0;
22908  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
22909 
22910  /* "View.MemoryView":1179
22911  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
22912  * "Return the size of the memory occupied by the slice in number of bytes"
22913  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
22914  *
22915  * for shape in src.shape[:ndim]:
22916  */
22917  __Pyx_TraceLine(1179,1,__PYX_ERR(1, 1179, __pyx_L1_error))
22918  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
22919  __pyx_v_size = __pyx_t_1;
22920 
22921  /* "View.MemoryView":1181
22922  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
22923  *
22924  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
22925  * size *= shape
22926  *
22927  */
22928  __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
22929  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
22930  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
22931  __pyx_t_2 = __pyx_t_4;
22932  __pyx_v_shape = (__pyx_t_2[0]);
22933 
22934  /* "View.MemoryView":1182
22935  *
22936  * for shape in src.shape[:ndim]:
22937  * size *= shape # <<<<<<<<<<<<<<
22938  *
22939  * return size
22940  */
22941  __Pyx_TraceLine(1182,1,__PYX_ERR(1, 1182, __pyx_L1_error))
22942  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
22943  }
22944 
22945  /* "View.MemoryView":1184
22946  * size *= shape
22947  *
22948  * return size # <<<<<<<<<<<<<<
22949  *
22950  * @cname('__pyx_fill_contig_strides_array')
22951  */
22952  __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
22953  __pyx_r = __pyx_v_size;
22954  goto __pyx_L0;
22955 
22956  /* "View.MemoryView":1177
22957  *
22958  * @cname('__pyx_memoryview_slice_get_size')
22959  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
22960  * "Return the size of the memory occupied by the slice in number of bytes"
22961  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
22962  */
22963 
22964  /* function exit code */
22965  __pyx_L1_error:;
22966  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
22967  __pyx_r = 0;
22968  __pyx_L0:;
22969  __Pyx_TraceReturn(Py_None, 1);
22970  return __pyx_r;
22971 }
22972 
22973 /* "View.MemoryView":1187
22974  *
22975  * @cname('__pyx_fill_contig_strides_array')
22976  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
22977  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
22978  * int ndim, char order) nogil:
22979  */
22980 
22981 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
22982  int __pyx_v_idx;
22983  Py_ssize_t __pyx_r;
22984  __Pyx_TraceDeclarations
22985  int __pyx_t_1;
22986  int __pyx_t_2;
22987  int __pyx_t_3;
22988  int __pyx_t_4;
22989  int __pyx_lineno = 0;
22990  const char *__pyx_filename = NULL;
22991  int __pyx_clineno = 0;
22992  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
22993 
22994  /* "View.MemoryView":1196
22995  * cdef int idx
22996  *
22997  * if order == 'F': # <<<<<<<<<<<<<<
22998  * for idx in range(ndim):
22999  * strides[idx] = stride
23000  */
23001  __Pyx_TraceLine(1196,1,__PYX_ERR(1, 1196, __pyx_L1_error))
23002  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
23003  if (__pyx_t_1) {
23004 
23005  /* "View.MemoryView":1197
23006  *
23007  * if order == 'F':
23008  * for idx in range(ndim): # <<<<<<<<<<<<<<
23009  * strides[idx] = stride
23010  * stride *= shape[idx]
23011  */
23012  __Pyx_TraceLine(1197,1,__PYX_ERR(1, 1197, __pyx_L1_error))
23013  __pyx_t_2 = __pyx_v_ndim;
23014  __pyx_t_3 = __pyx_t_2;
23015  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23016  __pyx_v_idx = __pyx_t_4;
23017 
23018  /* "View.MemoryView":1198
23019  * if order == 'F':
23020  * for idx in range(ndim):
23021  * strides[idx] = stride # <<<<<<<<<<<<<<
23022  * stride *= shape[idx]
23023  * else:
23024  */
23025  __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
23026  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23027 
23028  /* "View.MemoryView":1199
23029  * for idx in range(ndim):
23030  * strides[idx] = stride
23031  * stride *= shape[idx] # <<<<<<<<<<<<<<
23032  * else:
23033  * for idx in range(ndim - 1, -1, -1):
23034  */
23035  __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
23036  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23037  }
23038 
23039  /* "View.MemoryView":1196
23040  * cdef int idx
23041  *
23042  * if order == 'F': # <<<<<<<<<<<<<<
23043  * for idx in range(ndim):
23044  * strides[idx] = stride
23045  */
23046  goto __pyx_L3;
23047  }
23048 
23049  /* "View.MemoryView":1201
23050  * stride *= shape[idx]
23051  * else:
23052  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
23053  * strides[idx] = stride
23054  * stride *= shape[idx]
23055  */
23056  __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
23057  /*else*/ {
23058  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
23059  __pyx_v_idx = __pyx_t_2;
23060 
23061  /* "View.MemoryView":1202
23062  * else:
23063  * for idx in range(ndim - 1, -1, -1):
23064  * strides[idx] = stride # <<<<<<<<<<<<<<
23065  * stride *= shape[idx]
23066  *
23067  */
23068  __Pyx_TraceLine(1202,1,__PYX_ERR(1, 1202, __pyx_L1_error))
23069  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23070 
23071  /* "View.MemoryView":1203
23072  * for idx in range(ndim - 1, -1, -1):
23073  * strides[idx] = stride
23074  * stride *= shape[idx] # <<<<<<<<<<<<<<
23075  *
23076  * return stride
23077  */
23078  __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
23079  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23080  }
23081  }
23082  __pyx_L3:;
23083 
23084  /* "View.MemoryView":1205
23085  * stride *= shape[idx]
23086  *
23087  * return stride # <<<<<<<<<<<<<<
23088  *
23089  * @cname('__pyx_memoryview_copy_data_to_temp')
23090  */
23091  __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
23092  __pyx_r = __pyx_v_stride;
23093  goto __pyx_L0;
23094 
23095  /* "View.MemoryView":1187
23096  *
23097  * @cname('__pyx_fill_contig_strides_array')
23098  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
23099  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23100  * int ndim, char order) nogil:
23101  */
23102 
23103  /* function exit code */
23104  __pyx_L1_error:;
23105  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23106  __pyx_r = 0;
23107  __pyx_L0:;
23108  __Pyx_TraceReturn(Py_None, 1);
23109  return __pyx_r;
23110 }
23111 
23112 /* "View.MemoryView":1208
23113  *
23114  * @cname('__pyx_memoryview_copy_data_to_temp')
23115  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23116  * __Pyx_memviewslice *tmpslice,
23117  * char order,
23118  */
23119 
23120 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
23121  int __pyx_v_i;
23122  void *__pyx_v_result;
23123  size_t __pyx_v_itemsize;
23124  size_t __pyx_v_size;
23125  void *__pyx_r;
23126  __Pyx_TraceDeclarations
23127  Py_ssize_t __pyx_t_1;
23128  int __pyx_t_2;
23129  int __pyx_t_3;
23130  struct __pyx_memoryview_obj *__pyx_t_4;
23131  int __pyx_t_5;
23132  int __pyx_t_6;
23133  int __pyx_lineno = 0;
23134  const char *__pyx_filename = NULL;
23135  int __pyx_clineno = 0;
23136  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
23137 
23138  /* "View.MemoryView":1219
23139  * cdef void *result
23140  *
23141  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
23142  * cdef size_t size = slice_get_size(src, ndim)
23143  *
23144  */
23145  __Pyx_TraceLine(1219,1,__PYX_ERR(1, 1219, __pyx_L1_error))
23146  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23147  __pyx_v_itemsize = __pyx_t_1;
23148 
23149  /* "View.MemoryView":1220
23150  *
23151  * cdef size_t itemsize = src.memview.view.itemsize
23152  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
23153  *
23154  * result = malloc(size)
23155  */
23156  __Pyx_TraceLine(1220,1,__PYX_ERR(1, 1220, __pyx_L1_error))
23157  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
23158 
23159  /* "View.MemoryView":1222
23160  * cdef size_t size = slice_get_size(src, ndim)
23161  *
23162  * result = malloc(size) # <<<<<<<<<<<<<<
23163  * if not result:
23164  * _err(MemoryError, NULL)
23165  */
23166  __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
23167  __pyx_v_result = malloc(__pyx_v_size);
23168 
23169  /* "View.MemoryView":1223
23170  *
23171  * result = malloc(size)
23172  * if not result: # <<<<<<<<<<<<<<
23173  * _err(MemoryError, NULL)
23174  *
23175  */
23176  __Pyx_TraceLine(1223,1,__PYX_ERR(1, 1223, __pyx_L1_error))
23177  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
23178  if (__pyx_t_2) {
23179 
23180  /* "View.MemoryView":1224
23181  * result = malloc(size)
23182  * if not result:
23183  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
23184  *
23185  *
23186  */
23187  __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
23188  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
23189 
23190  /* "View.MemoryView":1223
23191  *
23192  * result = malloc(size)
23193  * if not result: # <<<<<<<<<<<<<<
23194  * _err(MemoryError, NULL)
23195  *
23196  */
23197  }
23198 
23199  /* "View.MemoryView":1227
23200  *
23201  *
23202  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
23203  * tmpslice.memview = src.memview
23204  * for i in range(ndim):
23205  */
23206  __Pyx_TraceLine(1227,1,__PYX_ERR(1, 1227, __pyx_L1_error))
23207  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
23208 
23209  /* "View.MemoryView":1228
23210  *
23211  * tmpslice.data = <char *> result
23212  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
23213  * for i in range(ndim):
23214  * tmpslice.shape[i] = src.shape[i]
23215  */
23216  __Pyx_TraceLine(1228,1,__PYX_ERR(1, 1228, __pyx_L1_error))
23217  __pyx_t_4 = __pyx_v_src->memview;
23218  __pyx_v_tmpslice->memview = __pyx_t_4;
23219 
23220  /* "View.MemoryView":1229
23221  * tmpslice.data = <char *> result
23222  * tmpslice.memview = src.memview
23223  * for i in range(ndim): # <<<<<<<<<<<<<<
23224  * tmpslice.shape[i] = src.shape[i]
23225  * tmpslice.suboffsets[i] = -1
23226  */
23227  __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
23228  __pyx_t_3 = __pyx_v_ndim;
23229  __pyx_t_5 = __pyx_t_3;
23230  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23231  __pyx_v_i = __pyx_t_6;
23232 
23233  /* "View.MemoryView":1230
23234  * tmpslice.memview = src.memview
23235  * for i in range(ndim):
23236  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
23237  * tmpslice.suboffsets[i] = -1
23238  *
23239  */
23240  __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
23241  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
23242 
23243  /* "View.MemoryView":1231
23244  * for i in range(ndim):
23245  * tmpslice.shape[i] = src.shape[i]
23246  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
23247  *
23248  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
23249  */
23250  __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
23251  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
23252  }
23253 
23254  /* "View.MemoryView":1233
23255  * tmpslice.suboffsets[i] = -1
23256  *
23257  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
23258  * ndim, order)
23259  *
23260  */
23261  __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
23262  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
23263 
23264  /* "View.MemoryView":1237
23265  *
23266  *
23267  * for i in range(ndim): # <<<<<<<<<<<<<<
23268  * if tmpslice.shape[i] == 1:
23269  * tmpslice.strides[i] = 0
23270  */
23271  __Pyx_TraceLine(1237,1,__PYX_ERR(1, 1237, __pyx_L1_error))
23272  __pyx_t_3 = __pyx_v_ndim;
23273  __pyx_t_5 = __pyx_t_3;
23274  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23275  __pyx_v_i = __pyx_t_6;
23276 
23277  /* "View.MemoryView":1238
23278  *
23279  * for i in range(ndim):
23280  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
23281  * tmpslice.strides[i] = 0
23282  *
23283  */
23284  __Pyx_TraceLine(1238,1,__PYX_ERR(1, 1238, __pyx_L1_error))
23285  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
23286  if (__pyx_t_2) {
23287 
23288  /* "View.MemoryView":1239
23289  * for i in range(ndim):
23290  * if tmpslice.shape[i] == 1:
23291  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
23292  *
23293  * if slice_is_contig(src[0], order, ndim):
23294  */
23295  __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
23296  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
23297 
23298  /* "View.MemoryView":1238
23299  *
23300  * for i in range(ndim):
23301  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
23302  * tmpslice.strides[i] = 0
23303  *
23304  */
23305  }
23306  }
23307 
23308  /* "View.MemoryView":1241
23309  * tmpslice.strides[i] = 0
23310  *
23311  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
23312  * memcpy(result, src.data, size)
23313  * else:
23314  */
23315  __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
23316  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
23317  if (__pyx_t_2) {
23318 
23319  /* "View.MemoryView":1242
23320  *
23321  * if slice_is_contig(src[0], order, ndim):
23322  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
23323  * else:
23324  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
23325  */
23326  __Pyx_TraceLine(1242,1,__PYX_ERR(1, 1242, __pyx_L1_error))
23327  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
23328 
23329  /* "View.MemoryView":1241
23330  * tmpslice.strides[i] = 0
23331  *
23332  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
23333  * memcpy(result, src.data, size)
23334  * else:
23335  */
23336  goto __pyx_L9;
23337  }
23338 
23339  /* "View.MemoryView":1244
23340  * memcpy(result, src.data, size)
23341  * else:
23342  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
23343  *
23344  * return result
23345  */
23346  __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
23347  /*else*/ {
23348  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
23349  }
23350  __pyx_L9:;
23351 
23352  /* "View.MemoryView":1246
23353  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
23354  *
23355  * return result # <<<<<<<<<<<<<<
23356  *
23357  *
23358  */
23359  __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
23360  __pyx_r = __pyx_v_result;
23361  goto __pyx_L0;
23362 
23363  /* "View.MemoryView":1208
23364  *
23365  * @cname('__pyx_memoryview_copy_data_to_temp')
23366  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23367  * __Pyx_memviewslice *tmpslice,
23368  * char order,
23369  */
23370 
23371  /* function exit code */
23372  __pyx_L1_error:;
23373  {
23374  #ifdef WITH_THREAD
23375  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23376  #endif
23377  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
23378  #ifdef WITH_THREAD
23379  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23380  #endif
23381  }
23382  __pyx_r = NULL;
23383  __pyx_L0:;
23384  __Pyx_TraceReturn(Py_None, 1);
23385  return __pyx_r;
23386 }
23387 
23388 /* "View.MemoryView":1251
23389  *
23390  * @cname('__pyx_memoryview_err_extents')
23391  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
23392  * Py_ssize_t extent2) except -1 with gil:
23393  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23394  */
23395 
23396 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
23397  int __pyx_r;
23398  __Pyx_TraceDeclarations
23399  __Pyx_RefNannyDeclarations
23400  PyObject *__pyx_t_1 = NULL;
23401  PyObject *__pyx_t_2 = NULL;
23402  PyObject *__pyx_t_3 = NULL;
23403  PyObject *__pyx_t_4 = NULL;
23404  int __pyx_lineno = 0;
23405  const char *__pyx_filename = NULL;
23406  int __pyx_clineno = 0;
23407  #ifdef WITH_THREAD
23408  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23409  #endif
23410  __Pyx_RefNannySetupContext("_err_extents", 0);
23411  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
23412 
23413  /* "View.MemoryView":1254
23414  * Py_ssize_t extent2) except -1 with gil:
23415  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23416  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
23417  *
23418  * @cname('__pyx_memoryview_err_dim')
23419  */
23420  __Pyx_TraceLine(1254,0,__PYX_ERR(1, 1254, __pyx_L1_error))
23421  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
23422  __Pyx_GOTREF(__pyx_t_1);
23423  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
23424  __Pyx_GOTREF(__pyx_t_2);
23425  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
23426  __Pyx_GOTREF(__pyx_t_3);
23427  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
23428  __Pyx_GOTREF(__pyx_t_4);
23429  __Pyx_GIVEREF(__pyx_t_1);
23430  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
23431  __Pyx_GIVEREF(__pyx_t_2);
23432  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
23433  __Pyx_GIVEREF(__pyx_t_3);
23434  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
23435  __pyx_t_1 = 0;
23436  __pyx_t_2 = 0;
23437  __pyx_t_3 = 0;
23438 
23439  /* "View.MemoryView":1253
23440  * cdef int _err_extents(int i, Py_ssize_t extent1,
23441  * Py_ssize_t extent2) except -1 with gil:
23442  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
23443  * (i, extent1, extent2))
23444  *
23445  */
23446  __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
23447  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
23448  __Pyx_GOTREF(__pyx_t_3);
23449  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23450  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
23451  __Pyx_GOTREF(__pyx_t_4);
23452  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23453  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23454  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23455  __PYX_ERR(1, 1253, __pyx_L1_error)
23456 
23457  /* "View.MemoryView":1251
23458  *
23459  * @cname('__pyx_memoryview_err_extents')
23460  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
23461  * Py_ssize_t extent2) except -1 with gil:
23462  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23463  */
23464 
23465  /* function exit code */
23466  __pyx_L1_error:;
23467  __Pyx_XDECREF(__pyx_t_1);
23468  __Pyx_XDECREF(__pyx_t_2);
23469  __Pyx_XDECREF(__pyx_t_3);
23470  __Pyx_XDECREF(__pyx_t_4);
23471  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
23472  __pyx_r = -1;
23473  __Pyx_TraceReturn(Py_None, 0);
23474  __Pyx_RefNannyFinishContext();
23475  #ifdef WITH_THREAD
23476  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23477  #endif
23478  return __pyx_r;
23479 }
23480 
23481 /* "View.MemoryView":1257
23482  *
23483  * @cname('__pyx_memoryview_err_dim')
23484  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
23485  * raise error(msg.decode('ascii') % dim)
23486  *
23487  */
23488 
23489 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
23490  int __pyx_r;
23491  __Pyx_TraceDeclarations
23492  __Pyx_RefNannyDeclarations
23493  PyObject *__pyx_t_1 = NULL;
23494  PyObject *__pyx_t_2 = NULL;
23495  PyObject *__pyx_t_3 = NULL;
23496  PyObject *__pyx_t_4 = NULL;
23497  int __pyx_lineno = 0;
23498  const char *__pyx_filename = NULL;
23499  int __pyx_clineno = 0;
23500  #ifdef WITH_THREAD
23501  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23502  #endif
23503  __Pyx_RefNannySetupContext("_err_dim", 0);
23504  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
23505  __Pyx_INCREF(__pyx_v_error);
23506 
23507  /* "View.MemoryView":1258
23508  * @cname('__pyx_memoryview_err_dim')
23509  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
23510  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
23511  *
23512  * @cname('__pyx_memoryview_err')
23513  */
23514  __Pyx_TraceLine(1258,0,__PYX_ERR(1, 1258, __pyx_L1_error))
23515  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
23516  __Pyx_GOTREF(__pyx_t_2);
23517  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
23518  __Pyx_GOTREF(__pyx_t_3);
23519  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
23520  __Pyx_GOTREF(__pyx_t_4);
23521  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23522  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23523  __Pyx_INCREF(__pyx_v_error);
23524  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
23525  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
23526  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
23527  if (likely(__pyx_t_2)) {
23528  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23529  __Pyx_INCREF(__pyx_t_2);
23530  __Pyx_INCREF(function);
23531  __Pyx_DECREF_SET(__pyx_t_3, function);
23532  }
23533  }
23534  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
23535  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23536  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23537  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
23538  __Pyx_GOTREF(__pyx_t_1);
23539  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23540  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23541  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23542  __PYX_ERR(1, 1258, __pyx_L1_error)
23543 
23544  /* "View.MemoryView":1257
23545  *
23546  * @cname('__pyx_memoryview_err_dim')
23547  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
23548  * raise error(msg.decode('ascii') % dim)
23549  *
23550  */
23551 
23552  /* function exit code */
23553  __pyx_L1_error:;
23554  __Pyx_XDECREF(__pyx_t_1);
23555  __Pyx_XDECREF(__pyx_t_2);
23556  __Pyx_XDECREF(__pyx_t_3);
23557  __Pyx_XDECREF(__pyx_t_4);
23558  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
23559  __pyx_r = -1;
23560  __Pyx_XDECREF(__pyx_v_error);
23561  __Pyx_TraceReturn(Py_None, 0);
23562  __Pyx_RefNannyFinishContext();
23563  #ifdef WITH_THREAD
23564  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23565  #endif
23566  return __pyx_r;
23567 }
23568 
23569 /* "View.MemoryView":1261
23570  *
23571  * @cname('__pyx_memoryview_err')
23572  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
23573  * if msg != NULL:
23574  * raise error(msg.decode('ascii'))
23575  */
23576 
23577 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
23578  int __pyx_r;
23579  __Pyx_TraceDeclarations
23580  __Pyx_RefNannyDeclarations
23581  int __pyx_t_1;
23582  PyObject *__pyx_t_2 = NULL;
23583  PyObject *__pyx_t_3 = NULL;
23584  PyObject *__pyx_t_4 = NULL;
23585  PyObject *__pyx_t_5 = NULL;
23586  int __pyx_lineno = 0;
23587  const char *__pyx_filename = NULL;
23588  int __pyx_clineno = 0;
23589  #ifdef WITH_THREAD
23590  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23591  #endif
23592  __Pyx_RefNannySetupContext("_err", 0);
23593  __Pyx_TraceCall("_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
23594  __Pyx_INCREF(__pyx_v_error);
23595 
23596  /* "View.MemoryView":1262
23597  * @cname('__pyx_memoryview_err')
23598  * cdef int _err(object error, char *msg) except -1 with gil:
23599  * if msg != NULL: # <<<<<<<<<<<<<<
23600  * raise error(msg.decode('ascii'))
23601  * else:
23602  */
23603  __Pyx_TraceLine(1262,0,__PYX_ERR(1, 1262, __pyx_L1_error))
23604  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
23605  if (unlikely(__pyx_t_1)) {
23606 
23607  /* "View.MemoryView":1263
23608  * cdef int _err(object error, char *msg) except -1 with gil:
23609  * if msg != NULL:
23610  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
23611  * else:
23612  * raise error
23613  */
23614  __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
23615  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
23616  __Pyx_GOTREF(__pyx_t_3);
23617  __Pyx_INCREF(__pyx_v_error);
23618  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
23619  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
23620  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
23621  if (likely(__pyx_t_5)) {
23622  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
23623  __Pyx_INCREF(__pyx_t_5);
23624  __Pyx_INCREF(function);
23625  __Pyx_DECREF_SET(__pyx_t_4, function);
23626  }
23627  }
23628  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
23629  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23630  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23631  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
23632  __Pyx_GOTREF(__pyx_t_2);
23633  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23634  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
23635  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23636  __PYX_ERR(1, 1263, __pyx_L1_error)
23637 
23638  /* "View.MemoryView":1262
23639  * @cname('__pyx_memoryview_err')
23640  * cdef int _err(object error, char *msg) except -1 with gil:
23641  * if msg != NULL: # <<<<<<<<<<<<<<
23642  * raise error(msg.decode('ascii'))
23643  * else:
23644  */
23645  }
23646 
23647  /* "View.MemoryView":1265
23648  * raise error(msg.decode('ascii'))
23649  * else:
23650  * raise error # <<<<<<<<<<<<<<
23651  *
23652  * @cname('__pyx_memoryview_copy_contents')
23653  */
23654  __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
23655  /*else*/ {
23656  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
23657  __PYX_ERR(1, 1265, __pyx_L1_error)
23658  }
23659 
23660  /* "View.MemoryView":1261
23661  *
23662  * @cname('__pyx_memoryview_err')
23663  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
23664  * if msg != NULL:
23665  * raise error(msg.decode('ascii'))
23666  */
23667 
23668  /* function exit code */
23669  __pyx_L1_error:;
23670  __Pyx_XDECREF(__pyx_t_2);
23671  __Pyx_XDECREF(__pyx_t_3);
23672  __Pyx_XDECREF(__pyx_t_4);
23673  __Pyx_XDECREF(__pyx_t_5);
23674  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
23675  __pyx_r = -1;
23676  __Pyx_XDECREF(__pyx_v_error);
23677  __Pyx_TraceReturn(Py_None, 0);
23678  __Pyx_RefNannyFinishContext();
23679  #ifdef WITH_THREAD
23680  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23681  #endif
23682  return __pyx_r;
23683 }
23684 
23685 /* "View.MemoryView":1268
23686  *
23687  * @cname('__pyx_memoryview_copy_contents')
23688  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
23689  * __Pyx_memviewslice dst,
23690  * int src_ndim, int dst_ndim,
23691  */
23692 
23693 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
23694  void *__pyx_v_tmpdata;
23695  size_t __pyx_v_itemsize;
23696  int __pyx_v_i;
23697  char __pyx_v_order;
23698  int __pyx_v_broadcasting;
23699  int __pyx_v_direct_copy;
23700  __Pyx_memviewslice __pyx_v_tmp;
23701  int __pyx_v_ndim;
23702  int __pyx_r;
23703  __Pyx_TraceDeclarations
23704  Py_ssize_t __pyx_t_1;
23705  int __pyx_t_2;
23706  int __pyx_t_3;
23707  int __pyx_t_4;
23708  int __pyx_t_5;
23709  int __pyx_t_6;
23710  void *__pyx_t_7;
23711  int __pyx_t_8;
23712  int __pyx_lineno = 0;
23713  const char *__pyx_filename = NULL;
23714  int __pyx_clineno = 0;
23715  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
23716 
23717  /* "View.MemoryView":1276
23718  * Check for overlapping memory and verify the shapes.
23719  * """
23720  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
23721  * cdef size_t itemsize = src.memview.view.itemsize
23722  * cdef int i
23723  */
23724  __Pyx_TraceLine(1276,1,__PYX_ERR(1, 1276, __pyx_L1_error))
23725  __pyx_v_tmpdata = NULL;
23726 
23727  /* "View.MemoryView":1277
23728  * """
23729  * cdef void *tmpdata = NULL
23730  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
23731  * cdef int i
23732  * cdef char order = get_best_order(&src, src_ndim)
23733  */
23734  __Pyx_TraceLine(1277,1,__PYX_ERR(1, 1277, __pyx_L1_error))
23735  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
23736  __pyx_v_itemsize = __pyx_t_1;
23737 
23738  /* "View.MemoryView":1279
23739  * cdef size_t itemsize = src.memview.view.itemsize
23740  * cdef int i
23741  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
23742  * cdef bint broadcasting = False
23743  * cdef bint direct_copy = False
23744  */
23745  __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
23746  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
23747 
23748  /* "View.MemoryView":1280
23749  * cdef int i
23750  * cdef char order = get_best_order(&src, src_ndim)
23751  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
23752  * cdef bint direct_copy = False
23753  * cdef __Pyx_memviewslice tmp
23754  */
23755  __Pyx_TraceLine(1280,1,__PYX_ERR(1, 1280, __pyx_L1_error))
23756  __pyx_v_broadcasting = 0;
23757 
23758  /* "View.MemoryView":1281
23759  * cdef char order = get_best_order(&src, src_ndim)
23760  * cdef bint broadcasting = False
23761  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
23762  * cdef __Pyx_memviewslice tmp
23763  *
23764  */
23765  __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
23766  __pyx_v_direct_copy = 0;
23767 
23768  /* "View.MemoryView":1284
23769  * cdef __Pyx_memviewslice tmp
23770  *
23771  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
23772  * broadcast_leading(&src, src_ndim, dst_ndim)
23773  * elif dst_ndim < src_ndim:
23774  */
23775  __Pyx_TraceLine(1284,1,__PYX_ERR(1, 1284, __pyx_L1_error))
23776  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
23777  if (__pyx_t_2) {
23778 
23779  /* "View.MemoryView":1285
23780  *
23781  * if src_ndim < dst_ndim:
23782  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
23783  * elif dst_ndim < src_ndim:
23784  * broadcast_leading(&dst, dst_ndim, src_ndim)
23785  */
23786  __Pyx_TraceLine(1285,1,__PYX_ERR(1, 1285, __pyx_L1_error))
23787  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
23788 
23789  /* "View.MemoryView":1284
23790  * cdef __Pyx_memviewslice tmp
23791  *
23792  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
23793  * broadcast_leading(&src, src_ndim, dst_ndim)
23794  * elif dst_ndim < src_ndim:
23795  */
23796  goto __pyx_L3;
23797  }
23798 
23799  /* "View.MemoryView":1286
23800  * if src_ndim < dst_ndim:
23801  * broadcast_leading(&src, src_ndim, dst_ndim)
23802  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
23803  * broadcast_leading(&dst, dst_ndim, src_ndim)
23804  *
23805  */
23806  __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
23807  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
23808  if (__pyx_t_2) {
23809 
23810  /* "View.MemoryView":1287
23811  * broadcast_leading(&src, src_ndim, dst_ndim)
23812  * elif dst_ndim < src_ndim:
23813  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
23814  *
23815  * cdef int ndim = max(src_ndim, dst_ndim)
23816  */
23817  __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
23818  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
23819 
23820  /* "View.MemoryView":1286
23821  * if src_ndim < dst_ndim:
23822  * broadcast_leading(&src, src_ndim, dst_ndim)
23823  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
23824  * broadcast_leading(&dst, dst_ndim, src_ndim)
23825  *
23826  */
23827  }
23828  __pyx_L3:;
23829 
23830  /* "View.MemoryView":1289
23831  * broadcast_leading(&dst, dst_ndim, src_ndim)
23832  *
23833  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
23834  *
23835  * for i in range(ndim):
23836  */
23837  __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
23838  __pyx_t_3 = __pyx_v_dst_ndim;
23839  __pyx_t_4 = __pyx_v_src_ndim;
23840  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
23841  __pyx_t_5 = __pyx_t_3;
23842  } else {
23843  __pyx_t_5 = __pyx_t_4;
23844  }
23845  __pyx_v_ndim = __pyx_t_5;
23846 
23847  /* "View.MemoryView":1291
23848  * cdef int ndim = max(src_ndim, dst_ndim)
23849  *
23850  * for i in range(ndim): # <<<<<<<<<<<<<<
23851  * if src.shape[i] != dst.shape[i]:
23852  * if src.shape[i] == 1:
23853  */
23854  __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
23855  __pyx_t_5 = __pyx_v_ndim;
23856  __pyx_t_3 = __pyx_t_5;
23857  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23858  __pyx_v_i = __pyx_t_4;
23859 
23860  /* "View.MemoryView":1292
23861  *
23862  * for i in range(ndim):
23863  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
23864  * if src.shape[i] == 1:
23865  * broadcasting = True
23866  */
23867  __Pyx_TraceLine(1292,1,__PYX_ERR(1, 1292, __pyx_L1_error))
23868  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
23869  if (__pyx_t_2) {
23870 
23871  /* "View.MemoryView":1293
23872  * for i in range(ndim):
23873  * if src.shape[i] != dst.shape[i]:
23874  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
23875  * broadcasting = True
23876  * src.strides[i] = 0
23877  */
23878  __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
23879  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
23880  if (__pyx_t_2) {
23881 
23882  /* "View.MemoryView":1294
23883  * if src.shape[i] != dst.shape[i]:
23884  * if src.shape[i] == 1:
23885  * broadcasting = True # <<<<<<<<<<<<<<
23886  * src.strides[i] = 0
23887  * else:
23888  */
23889  __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
23890  __pyx_v_broadcasting = 1;
23891 
23892  /* "View.MemoryView":1295
23893  * if src.shape[i] == 1:
23894  * broadcasting = True
23895  * src.strides[i] = 0 # <<<<<<<<<<<<<<
23896  * else:
23897  * _err_extents(i, dst.shape[i], src.shape[i])
23898  */
23899  __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
23900  (__pyx_v_src.strides[__pyx_v_i]) = 0;
23901 
23902  /* "View.MemoryView":1293
23903  * for i in range(ndim):
23904  * if src.shape[i] != dst.shape[i]:
23905  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
23906  * broadcasting = True
23907  * src.strides[i] = 0
23908  */
23909  goto __pyx_L7;
23910  }
23911 
23912  /* "View.MemoryView":1297
23913  * src.strides[i] = 0
23914  * else:
23915  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
23916  *
23917  * if src.suboffsets[i] >= 0:
23918  */
23919  __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
23920  /*else*/ {
23921  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
23922  }
23923  __pyx_L7:;
23924 
23925  /* "View.MemoryView":1292
23926  *
23927  * for i in range(ndim):
23928  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
23929  * if src.shape[i] == 1:
23930  * broadcasting = True
23931  */
23932  }
23933 
23934  /* "View.MemoryView":1299
23935  * _err_extents(i, dst.shape[i], src.shape[i])
23936  *
23937  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
23938  * _err_dim(ValueError, "Dimension %d is not direct", i)
23939  *
23940  */
23941  __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
23942  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
23943  if (__pyx_t_2) {
23944 
23945  /* "View.MemoryView":1300
23946  *
23947  * if src.suboffsets[i] >= 0:
23948  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
23949  *
23950  * if slices_overlap(&src, &dst, ndim, itemsize):
23951  */
23952  __Pyx_TraceLine(1300,1,__PYX_ERR(1, 1300, __pyx_L1_error))
23953  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
23954 
23955  /* "View.MemoryView":1299
23956  * _err_extents(i, dst.shape[i], src.shape[i])
23957  *
23958  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
23959  * _err_dim(ValueError, "Dimension %d is not direct", i)
23960  *
23961  */
23962  }
23963  }
23964 
23965  /* "View.MemoryView":1302
23966  * _err_dim(ValueError, "Dimension %d is not direct", i)
23967  *
23968  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
23969  *
23970  * if not slice_is_contig(src, order, ndim):
23971  */
23972  __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
23973  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
23974  if (__pyx_t_2) {
23975 
23976  /* "View.MemoryView":1304
23977  * if slices_overlap(&src, &dst, ndim, itemsize):
23978  *
23979  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
23980  * order = get_best_order(&dst, ndim)
23981  *
23982  */
23983  __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
23984  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
23985  if (__pyx_t_2) {
23986 
23987  /* "View.MemoryView":1305
23988  *
23989  * if not slice_is_contig(src, order, ndim):
23990  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
23991  *
23992  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
23993  */
23994  __Pyx_TraceLine(1305,1,__PYX_ERR(1, 1305, __pyx_L1_error))
23995  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
23996 
23997  /* "View.MemoryView":1304
23998  * if slices_overlap(&src, &dst, ndim, itemsize):
23999  *
24000  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
24001  * order = get_best_order(&dst, ndim)
24002  *
24003  */
24004  }
24005 
24006  /* "View.MemoryView":1307
24007  * order = get_best_order(&dst, ndim)
24008  *
24009  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
24010  * src = tmp
24011  *
24012  */
24013  __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
24014  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
24015  __pyx_v_tmpdata = __pyx_t_7;
24016 
24017  /* "View.MemoryView":1308
24018  *
24019  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
24020  * src = tmp # <<<<<<<<<<<<<<
24021  *
24022  * if not broadcasting:
24023  */
24024  __Pyx_TraceLine(1308,1,__PYX_ERR(1, 1308, __pyx_L1_error))
24025  __pyx_v_src = __pyx_v_tmp;
24026 
24027  /* "View.MemoryView":1302
24028  * _err_dim(ValueError, "Dimension %d is not direct", i)
24029  *
24030  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
24031  *
24032  * if not slice_is_contig(src, order, ndim):
24033  */
24034  }
24035 
24036  /* "View.MemoryView":1310
24037  * src = tmp
24038  *
24039  * if not broadcasting: # <<<<<<<<<<<<<<
24040  *
24041  *
24042  */
24043  __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
24044  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
24045  if (__pyx_t_2) {
24046 
24047  /* "View.MemoryView":1313
24048  *
24049  *
24050  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
24051  * direct_copy = slice_is_contig(dst, 'C', ndim)
24052  * elif slice_is_contig(src, 'F', ndim):
24053  */
24054  __Pyx_TraceLine(1313,1,__PYX_ERR(1, 1313, __pyx_L1_error))
24055  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
24056  if (__pyx_t_2) {
24057 
24058  /* "View.MemoryView":1314
24059  *
24060  * if slice_is_contig(src, 'C', ndim):
24061  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
24062  * elif slice_is_contig(src, 'F', ndim):
24063  * direct_copy = slice_is_contig(dst, 'F', ndim)
24064  */
24065  __Pyx_TraceLine(1314,1,__PYX_ERR(1, 1314, __pyx_L1_error))
24066  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
24067 
24068  /* "View.MemoryView":1313
24069  *
24070  *
24071  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
24072  * direct_copy = slice_is_contig(dst, 'C', ndim)
24073  * elif slice_is_contig(src, 'F', ndim):
24074  */
24075  goto __pyx_L12;
24076  }
24077 
24078  /* "View.MemoryView":1315
24079  * if slice_is_contig(src, 'C', ndim):
24080  * direct_copy = slice_is_contig(dst, 'C', ndim)
24081  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
24082  * direct_copy = slice_is_contig(dst, 'F', ndim)
24083  *
24084  */
24085  __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
24086  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
24087  if (__pyx_t_2) {
24088 
24089  /* "View.MemoryView":1316
24090  * direct_copy = slice_is_contig(dst, 'C', ndim)
24091  * elif slice_is_contig(src, 'F', ndim):
24092  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
24093  *
24094  * if direct_copy:
24095  */
24096  __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
24097  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
24098 
24099  /* "View.MemoryView":1315
24100  * if slice_is_contig(src, 'C', ndim):
24101  * direct_copy = slice_is_contig(dst, 'C', ndim)
24102  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
24103  * direct_copy = slice_is_contig(dst, 'F', ndim)
24104  *
24105  */
24106  }
24107  __pyx_L12:;
24108 
24109  /* "View.MemoryView":1318
24110  * direct_copy = slice_is_contig(dst, 'F', ndim)
24111  *
24112  * if direct_copy: # <<<<<<<<<<<<<<
24113  *
24114  * refcount_copying(&dst, dtype_is_object, ndim, False)
24115  */
24116  __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
24117  __pyx_t_2 = (__pyx_v_direct_copy != 0);
24118  if (__pyx_t_2) {
24119 
24120  /* "View.MemoryView":1320
24121  * if direct_copy:
24122  *
24123  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
24124  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24125  * refcount_copying(&dst, dtype_is_object, ndim, True)
24126  */
24127  __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
24128  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24129 
24130  /* "View.MemoryView":1321
24131  *
24132  * refcount_copying(&dst, dtype_is_object, ndim, False)
24133  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
24134  * refcount_copying(&dst, dtype_is_object, ndim, True)
24135  * free(tmpdata)
24136  */
24137  __Pyx_TraceLine(1321,1,__PYX_ERR(1, 1321, __pyx_L1_error))
24138  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
24139 
24140  /* "View.MemoryView":1322
24141  * refcount_copying(&dst, dtype_is_object, ndim, False)
24142  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24143  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
24144  * free(tmpdata)
24145  * return 0
24146  */
24147  __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
24148  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24149 
24150  /* "View.MemoryView":1323
24151  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24152  * refcount_copying(&dst, dtype_is_object, ndim, True)
24153  * free(tmpdata) # <<<<<<<<<<<<<<
24154  * return 0
24155  *
24156  */
24157  __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
24158  free(__pyx_v_tmpdata);
24159 
24160  /* "View.MemoryView":1324
24161  * refcount_copying(&dst, dtype_is_object, ndim, True)
24162  * free(tmpdata)
24163  * return 0 # <<<<<<<<<<<<<<
24164  *
24165  * if order == 'F' == get_best_order(&dst, ndim):
24166  */
24167  __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
24168  __pyx_r = 0;
24169  goto __pyx_L0;
24170 
24171  /* "View.MemoryView":1318
24172  * direct_copy = slice_is_contig(dst, 'F', ndim)
24173  *
24174  * if direct_copy: # <<<<<<<<<<<<<<
24175  *
24176  * refcount_copying(&dst, dtype_is_object, ndim, False)
24177  */
24178  }
24179 
24180  /* "View.MemoryView":1310
24181  * src = tmp
24182  *
24183  * if not broadcasting: # <<<<<<<<<<<<<<
24184  *
24185  *
24186  */
24187  }
24188 
24189  /* "View.MemoryView":1326
24190  * return 0
24191  *
24192  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
24193  *
24194  *
24195  */
24196  __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
24197  __pyx_t_2 = (__pyx_v_order == 'F');
24198  if (__pyx_t_2) {
24199  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
24200  }
24201  __pyx_t_8 = (__pyx_t_2 != 0);
24202  if (__pyx_t_8) {
24203 
24204  /* "View.MemoryView":1329
24205  *
24206  *
24207  * transpose_memslice(&src) # <<<<<<<<<<<<<<
24208  * transpose_memslice(&dst)
24209  *
24210  */
24211  __Pyx_TraceLine(1329,1,__PYX_ERR(1, 1329, __pyx_L1_error))
24212  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
24213 
24214  /* "View.MemoryView":1330
24215  *
24216  * transpose_memslice(&src)
24217  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
24218  *
24219  * refcount_copying(&dst, dtype_is_object, ndim, False)
24220  */
24221  __Pyx_TraceLine(1330,1,__PYX_ERR(1, 1330, __pyx_L1_error))
24222  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
24223 
24224  /* "View.MemoryView":1326
24225  * return 0
24226  *
24227  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
24228  *
24229  *
24230  */
24231  }
24232 
24233  /* "View.MemoryView":1332
24234  * transpose_memslice(&dst)
24235  *
24236  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
24237  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
24238  * refcount_copying(&dst, dtype_is_object, ndim, True)
24239  */
24240  __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
24241  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24242 
24243  /* "View.MemoryView":1333
24244  *
24245  * refcount_copying(&dst, dtype_is_object, ndim, False)
24246  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
24247  * refcount_copying(&dst, dtype_is_object, ndim, True)
24248  *
24249  */
24250  __Pyx_TraceLine(1333,1,__PYX_ERR(1, 1333, __pyx_L1_error))
24251  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
24252 
24253  /* "View.MemoryView":1334
24254  * refcount_copying(&dst, dtype_is_object, ndim, False)
24255  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
24256  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
24257  *
24258  * free(tmpdata)
24259  */
24260  __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
24261  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24262 
24263  /* "View.MemoryView":1336
24264  * refcount_copying(&dst, dtype_is_object, ndim, True)
24265  *
24266  * free(tmpdata) # <<<<<<<<<<<<<<
24267  * return 0
24268  *
24269  */
24270  __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
24271  free(__pyx_v_tmpdata);
24272 
24273  /* "View.MemoryView":1337
24274  *
24275  * free(tmpdata)
24276  * return 0 # <<<<<<<<<<<<<<
24277  *
24278  * @cname('__pyx_memoryview_broadcast_leading')
24279  */
24280  __Pyx_TraceLine(1337,1,__PYX_ERR(1, 1337, __pyx_L1_error))
24281  __pyx_r = 0;
24282  goto __pyx_L0;
24283 
24284  /* "View.MemoryView":1268
24285  *
24286  * @cname('__pyx_memoryview_copy_contents')
24287  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
24288  * __Pyx_memviewslice dst,
24289  * int src_ndim, int dst_ndim,
24290  */
24291 
24292  /* function exit code */
24293  __pyx_L1_error:;
24294  {
24295  #ifdef WITH_THREAD
24296  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24297  #endif
24298  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
24299  #ifdef WITH_THREAD
24300  __Pyx_PyGILState_Release(__pyx_gilstate_save);
24301  #endif
24302  }
24303  __pyx_r = -1;
24304  __pyx_L0:;
24305  __Pyx_TraceReturn(Py_None, 1);
24306  return __pyx_r;
24307 }
24308 
24309 /* "View.MemoryView":1340
24310  *
24311  * @cname('__pyx_memoryview_broadcast_leading')
24312  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
24313  * int ndim,
24314  * int ndim_other) nogil:
24315  */
24316 
24317 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
24318  int __pyx_v_i;
24319  int __pyx_v_offset;
24320  __Pyx_TraceDeclarations
24321  int __pyx_t_1;
24322  int __pyx_t_2;
24323  int __pyx_t_3;
24324  int __pyx_lineno = 0;
24325  const char *__pyx_filename = NULL;
24326  int __pyx_clineno = 0;
24327  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
24328 
24329  /* "View.MemoryView":1344
24330  * int ndim_other) nogil:
24331  * cdef int i
24332  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
24333  *
24334  * for i in range(ndim - 1, -1, -1):
24335  */
24336  __Pyx_TraceLine(1344,1,__PYX_ERR(1, 1344, __pyx_L1_error))
24337  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
24338 
24339  /* "View.MemoryView":1346
24340  * cdef int offset = ndim_other - ndim
24341  *
24342  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
24343  * mslice.shape[i + offset] = mslice.shape[i]
24344  * mslice.strides[i + offset] = mslice.strides[i]
24345  */
24346  __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
24347  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
24348  __pyx_v_i = __pyx_t_1;
24349 
24350  /* "View.MemoryView":1347
24351  *
24352  * for i in range(ndim - 1, -1, -1):
24353  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
24354  * mslice.strides[i + offset] = mslice.strides[i]
24355  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24356  */
24357  __Pyx_TraceLine(1347,1,__PYX_ERR(1, 1347, __pyx_L1_error))
24358  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
24359 
24360  /* "View.MemoryView":1348
24361  * for i in range(ndim - 1, -1, -1):
24362  * mslice.shape[i + offset] = mslice.shape[i]
24363  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
24364  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24365  *
24366  */
24367  __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
24368  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
24369 
24370  /* "View.MemoryView":1349
24371  * mslice.shape[i + offset] = mslice.shape[i]
24372  * mslice.strides[i + offset] = mslice.strides[i]
24373  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
24374  *
24375  * for i in range(offset):
24376  */
24377  __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
24378  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
24379  }
24380 
24381  /* "View.MemoryView":1351
24382  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24383  *
24384  * for i in range(offset): # <<<<<<<<<<<<<<
24385  * mslice.shape[i] = 1
24386  * mslice.strides[i] = mslice.strides[0]
24387  */
24388  __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
24389  __pyx_t_1 = __pyx_v_offset;
24390  __pyx_t_2 = __pyx_t_1;
24391  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24392  __pyx_v_i = __pyx_t_3;
24393 
24394  /* "View.MemoryView":1352
24395  *
24396  * for i in range(offset):
24397  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
24398  * mslice.strides[i] = mslice.strides[0]
24399  * mslice.suboffsets[i] = -1
24400  */
24401  __Pyx_TraceLine(1352,1,__PYX_ERR(1, 1352, __pyx_L1_error))
24402  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
24403 
24404  /* "View.MemoryView":1353
24405  * for i in range(offset):
24406  * mslice.shape[i] = 1
24407  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
24408  * mslice.suboffsets[i] = -1
24409  *
24410  */
24411  __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
24412  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
24413 
24414  /* "View.MemoryView":1354
24415  * mslice.shape[i] = 1
24416  * mslice.strides[i] = mslice.strides[0]
24417  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
24418  *
24419  *
24420  */
24421  __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
24422  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
24423  }
24424 
24425  /* "View.MemoryView":1340
24426  *
24427  * @cname('__pyx_memoryview_broadcast_leading')
24428  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
24429  * int ndim,
24430  * int ndim_other) nogil:
24431  */
24432 
24433  /* function exit code */
24434  goto __pyx_L0;
24435  __pyx_L1_error:;
24436  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24437  __pyx_L0:;
24438  __Pyx_TraceReturn(Py_None, 1);
24439 }
24440 
24441 /* "View.MemoryView":1362
24442  *
24443  * @cname('__pyx_memoryview_refcount_copying')
24444  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
24445  * int ndim, bint inc) nogil:
24446  *
24447  */
24448 
24449 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
24450  __Pyx_TraceDeclarations
24451  int __pyx_t_1;
24452  int __pyx_lineno = 0;
24453  const char *__pyx_filename = NULL;
24454  int __pyx_clineno = 0;
24455  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
24456 
24457  /* "View.MemoryView":1366
24458  *
24459  *
24460  * if dtype_is_object: # <<<<<<<<<<<<<<
24461  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
24462  * dst.strides, ndim, inc)
24463  */
24464  __Pyx_TraceLine(1366,1,__PYX_ERR(1, 1366, __pyx_L1_error))
24465  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
24466  if (__pyx_t_1) {
24467 
24468  /* "View.MemoryView":1367
24469  *
24470  * if dtype_is_object:
24471  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
24472  * dst.strides, ndim, inc)
24473  *
24474  */
24475  __Pyx_TraceLine(1367,1,__PYX_ERR(1, 1367, __pyx_L1_error))
24476  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
24477 
24478  /* "View.MemoryView":1366
24479  *
24480  *
24481  * if dtype_is_object: # <<<<<<<<<<<<<<
24482  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
24483  * dst.strides, ndim, inc)
24484  */
24485  }
24486 
24487  /* "View.MemoryView":1362
24488  *
24489  * @cname('__pyx_memoryview_refcount_copying')
24490  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
24491  * int ndim, bint inc) nogil:
24492  *
24493  */
24494 
24495  /* function exit code */
24496  goto __pyx_L0;
24497  __pyx_L1_error:;
24498  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24499  __pyx_L0:;
24500  __Pyx_TraceReturn(Py_None, 1);
24501 }
24502 
24503 /* "View.MemoryView":1371
24504  *
24505  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
24506  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24507  * Py_ssize_t *strides, int ndim,
24508  * bint inc) with gil:
24509  */
24510 
24511 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
24512  __Pyx_TraceDeclarations
24513  __Pyx_RefNannyDeclarations
24514  int __pyx_lineno = 0;
24515  const char *__pyx_filename = NULL;
24516  int __pyx_clineno = 0;
24517  #ifdef WITH_THREAD
24518  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24519  #endif
24520  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
24521  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
24522 
24523  /* "View.MemoryView":1374
24524  * Py_ssize_t *strides, int ndim,
24525  * bint inc) with gil:
24526  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
24527  *
24528  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24529  */
24530  __Pyx_TraceLine(1374,0,__PYX_ERR(1, 1374, __pyx_L1_error))
24531  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
24532 
24533  /* "View.MemoryView":1371
24534  *
24535  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
24536  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24537  * Py_ssize_t *strides, int ndim,
24538  * bint inc) with gil:
24539  */
24540 
24541  /* function exit code */
24542  goto __pyx_L0;
24543  __pyx_L1_error:;
24544  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24545  __pyx_L0:;
24546  __Pyx_TraceReturn(Py_None, 0);
24547  __Pyx_RefNannyFinishContext();
24548  #ifdef WITH_THREAD
24549  __Pyx_PyGILState_Release(__pyx_gilstate_save);
24550  #endif
24551 }
24552 
24553 /* "View.MemoryView":1377
24554  *
24555  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24556  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24557  * Py_ssize_t *strides, int ndim, bint inc):
24558  * cdef Py_ssize_t i
24559  */
24560 
24561 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
24562  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24563  __Pyx_TraceDeclarations
24564  __Pyx_RefNannyDeclarations
24565  Py_ssize_t __pyx_t_1;
24566  Py_ssize_t __pyx_t_2;
24567  Py_ssize_t __pyx_t_3;
24568  int __pyx_t_4;
24569  int __pyx_lineno = 0;
24570  const char *__pyx_filename = NULL;
24571  int __pyx_clineno = 0;
24572  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
24573  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
24574 
24575  /* "View.MemoryView":1381
24576  * cdef Py_ssize_t i
24577  *
24578  * for i in range(shape[0]): # <<<<<<<<<<<<<<
24579  * if ndim == 1:
24580  * if inc:
24581  */
24582  __Pyx_TraceLine(1381,0,__PYX_ERR(1, 1381, __pyx_L1_error))
24583  __pyx_t_1 = (__pyx_v_shape[0]);
24584  __pyx_t_2 = __pyx_t_1;
24585  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24586  __pyx_v_i = __pyx_t_3;
24587 
24588  /* "View.MemoryView":1382
24589  *
24590  * for i in range(shape[0]):
24591  * if ndim == 1: # <<<<<<<<<<<<<<
24592  * if inc:
24593  * Py_INCREF((<PyObject **> data)[0])
24594  */
24595  __Pyx_TraceLine(1382,0,__PYX_ERR(1, 1382, __pyx_L1_error))
24596  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
24597  if (__pyx_t_4) {
24598 
24599  /* "View.MemoryView":1383
24600  * for i in range(shape[0]):
24601  * if ndim == 1:
24602  * if inc: # <<<<<<<<<<<<<<
24603  * Py_INCREF((<PyObject **> data)[0])
24604  * else:
24605  */
24606  __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
24607  __pyx_t_4 = (__pyx_v_inc != 0);
24608  if (__pyx_t_4) {
24609 
24610  /* "View.MemoryView":1384
24611  * if ndim == 1:
24612  * if inc:
24613  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
24614  * else:
24615  * Py_DECREF((<PyObject **> data)[0])
24616  */
24617  __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
24618  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
24619 
24620  /* "View.MemoryView":1383
24621  * for i in range(shape[0]):
24622  * if ndim == 1:
24623  * if inc: # <<<<<<<<<<<<<<
24624  * Py_INCREF((<PyObject **> data)[0])
24625  * else:
24626  */
24627  goto __pyx_L6;
24628  }
24629 
24630  /* "View.MemoryView":1386
24631  * Py_INCREF((<PyObject **> data)[0])
24632  * else:
24633  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
24634  * else:
24635  * refcount_objects_in_slice(data, shape + 1, strides + 1,
24636  */
24637  __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
24638  /*else*/ {
24639  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
24640  }
24641  __pyx_L6:;
24642 
24643  /* "View.MemoryView":1382
24644  *
24645  * for i in range(shape[0]):
24646  * if ndim == 1: # <<<<<<<<<<<<<<
24647  * if inc:
24648  * Py_INCREF((<PyObject **> data)[0])
24649  */
24650  goto __pyx_L5;
24651  }
24652 
24653  /* "View.MemoryView":1388
24654  * Py_DECREF((<PyObject **> data)[0])
24655  * else:
24656  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
24657  * ndim - 1, inc)
24658  *
24659  */
24660  __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
24661  /*else*/ {
24662 
24663  /* "View.MemoryView":1389
24664  * else:
24665  * refcount_objects_in_slice(data, shape + 1, strides + 1,
24666  * ndim - 1, inc) # <<<<<<<<<<<<<<
24667  *
24668  * data += strides[0]
24669  */
24670  __Pyx_TraceLine(1389,0,__PYX_ERR(1, 1389, __pyx_L1_error))
24671  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
24672  }
24673  __pyx_L5:;
24674 
24675  /* "View.MemoryView":1391
24676  * ndim - 1, inc)
24677  *
24678  * data += strides[0] # <<<<<<<<<<<<<<
24679  *
24680  *
24681  */
24682  __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
24683  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
24684  }
24685 
24686  /* "View.MemoryView":1377
24687  *
24688  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24689  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24690  * Py_ssize_t *strides, int ndim, bint inc):
24691  * cdef Py_ssize_t i
24692  */
24693 
24694  /* function exit code */
24695  goto __pyx_L0;
24696  __pyx_L1_error:;
24697  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24698  __pyx_L0:;
24699  __Pyx_TraceReturn(Py_None, 0);
24700  __Pyx_RefNannyFinishContext();
24701 }
24702 
24703 /* "View.MemoryView":1397
24704  *
24705  * @cname('__pyx_memoryview_slice_assign_scalar')
24706  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
24707  * size_t itemsize, void *item,
24708  * bint dtype_is_object) nogil:
24709  */
24710 
24711 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
24712  __Pyx_TraceDeclarations
24713  int __pyx_lineno = 0;
24714  const char *__pyx_filename = NULL;
24715  int __pyx_clineno = 0;
24716  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
24717 
24718  /* "View.MemoryView":1400
24719  * size_t itemsize, void *item,
24720  * bint dtype_is_object) nogil:
24721  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
24722  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
24723  * itemsize, item)
24724  */
24725  __Pyx_TraceLine(1400,1,__PYX_ERR(1, 1400, __pyx_L1_error))
24726  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24727 
24728  /* "View.MemoryView":1401
24729  * bint dtype_is_object) nogil:
24730  * refcount_copying(dst, dtype_is_object, ndim, False)
24731  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
24732  * itemsize, item)
24733  * refcount_copying(dst, dtype_is_object, ndim, True)
24734  */
24735  __Pyx_TraceLine(1401,1,__PYX_ERR(1, 1401, __pyx_L1_error))
24736  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
24737 
24738  /* "View.MemoryView":1403
24739  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
24740  * itemsize, item)
24741  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
24742  *
24743  *
24744  */
24745  __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
24746  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24747 
24748  /* "View.MemoryView":1397
24749  *
24750  * @cname('__pyx_memoryview_slice_assign_scalar')
24751  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
24752  * size_t itemsize, void *item,
24753  * bint dtype_is_object) nogil:
24754  */
24755 
24756  /* function exit code */
24757  goto __pyx_L0;
24758  __pyx_L1_error:;
24759  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24760  __pyx_L0:;
24761  __Pyx_TraceReturn(Py_None, 1);
24762 }
24763 
24764 /* "View.MemoryView":1407
24765  *
24766  * @cname('__pyx_memoryview__slice_assign_scalar')
24767  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24768  * Py_ssize_t *strides, int ndim,
24769  * size_t itemsize, void *item) nogil:
24770  */
24771 
24772 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
24773  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24774  Py_ssize_t __pyx_v_stride;
24775  Py_ssize_t __pyx_v_extent;
24776  __Pyx_TraceDeclarations
24777  int __pyx_t_1;
24778  Py_ssize_t __pyx_t_2;
24779  Py_ssize_t __pyx_t_3;
24780  Py_ssize_t __pyx_t_4;
24781  int __pyx_lineno = 0;
24782  const char *__pyx_filename = NULL;
24783  int __pyx_clineno = 0;
24784  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
24785 
24786  /* "View.MemoryView":1411
24787  * size_t itemsize, void *item) nogil:
24788  * cdef Py_ssize_t i
24789  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
24790  * cdef Py_ssize_t extent = shape[0]
24791  *
24792  */
24793  __Pyx_TraceLine(1411,1,__PYX_ERR(1, 1411, __pyx_L1_error))
24794  __pyx_v_stride = (__pyx_v_strides[0]);
24795 
24796  /* "View.MemoryView":1412
24797  * cdef Py_ssize_t i
24798  * cdef Py_ssize_t stride = strides[0]
24799  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
24800  *
24801  * if ndim == 1:
24802  */
24803  __Pyx_TraceLine(1412,1,__PYX_ERR(1, 1412, __pyx_L1_error))
24804  __pyx_v_extent = (__pyx_v_shape[0]);
24805 
24806  /* "View.MemoryView":1414
24807  * cdef Py_ssize_t extent = shape[0]
24808  *
24809  * if ndim == 1: # <<<<<<<<<<<<<<
24810  * for i in range(extent):
24811  * memcpy(data, item, itemsize)
24812  */
24813  __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
24814  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
24815  if (__pyx_t_1) {
24816 
24817  /* "View.MemoryView":1415
24818  *
24819  * if ndim == 1:
24820  * for i in range(extent): # <<<<<<<<<<<<<<
24821  * memcpy(data, item, itemsize)
24822  * data += stride
24823  */
24824  __Pyx_TraceLine(1415,1,__PYX_ERR(1, 1415, __pyx_L1_error))
24825  __pyx_t_2 = __pyx_v_extent;
24826  __pyx_t_3 = __pyx_t_2;
24827  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24828  __pyx_v_i = __pyx_t_4;
24829 
24830  /* "View.MemoryView":1416
24831  * if ndim == 1:
24832  * for i in range(extent):
24833  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
24834  * data += stride
24835  * else:
24836  */
24837  __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
24838  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
24839 
24840  /* "View.MemoryView":1417
24841  * for i in range(extent):
24842  * memcpy(data, item, itemsize)
24843  * data += stride # <<<<<<<<<<<<<<
24844  * else:
24845  * for i in range(extent):
24846  */
24847  __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
24848  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
24849  }
24850 
24851  /* "View.MemoryView":1414
24852  * cdef Py_ssize_t extent = shape[0]
24853  *
24854  * if ndim == 1: # <<<<<<<<<<<<<<
24855  * for i in range(extent):
24856  * memcpy(data, item, itemsize)
24857  */
24858  goto __pyx_L3;
24859  }
24860 
24861  /* "View.MemoryView":1419
24862  * data += stride
24863  * else:
24864  * for i in range(extent): # <<<<<<<<<<<<<<
24865  * _slice_assign_scalar(data, shape + 1, strides + 1,
24866  * ndim - 1, itemsize, item)
24867  */
24868  __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
24869  /*else*/ {
24870  __pyx_t_2 = __pyx_v_extent;
24871  __pyx_t_3 = __pyx_t_2;
24872  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24873  __pyx_v_i = __pyx_t_4;
24874 
24875  /* "View.MemoryView":1420
24876  * else:
24877  * for i in range(extent):
24878  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
24879  * ndim - 1, itemsize, item)
24880  * data += stride
24881  */
24882  __Pyx_TraceLine(1420,1,__PYX_ERR(1, 1420, __pyx_L1_error))
24883  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
24884 
24885  /* "View.MemoryView":1422
24886  * _slice_assign_scalar(data, shape + 1, strides + 1,
24887  * ndim - 1, itemsize, item)
24888  * data += stride # <<<<<<<<<<<<<<
24889  *
24890  *
24891  */
24892  __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
24893  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
24894  }
24895  }
24896  __pyx_L3:;
24897 
24898  /* "View.MemoryView":1407
24899  *
24900  * @cname('__pyx_memoryview__slice_assign_scalar')
24901  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
24902  * Py_ssize_t *strides, int ndim,
24903  * size_t itemsize, void *item) nogil:
24904  */
24905 
24906  /* function exit code */
24907  goto __pyx_L0;
24908  __pyx_L1_error:;
24909  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24910  __pyx_L0:;
24911  __Pyx_TraceReturn(Py_None, 1);
24912 }
24913 
24914 /* "(tree fragment)":1
24915  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24916  * cdef object __pyx_PickleError
24917  * cdef object __pyx_result
24918  */
24919 
24920 /* Python wrapper */
24921 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
24922 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
24923 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24924  PyObject *__pyx_v___pyx_type = 0;
24925  long __pyx_v___pyx_checksum;
24926  PyObject *__pyx_v___pyx_state = 0;
24927  int __pyx_lineno = 0;
24928  const char *__pyx_filename = NULL;
24929  int __pyx_clineno = 0;
24930  PyObject *__pyx_r = 0;
24931  __Pyx_RefNannyDeclarations
24932  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
24933  {
24934  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
24935  PyObject* values[3] = {0,0,0};
24936  if (unlikely(__pyx_kwds)) {
24937  Py_ssize_t kw_args;
24938  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
24939  switch (pos_args) {
24940  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24941  CYTHON_FALLTHROUGH;
24942  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24943  CYTHON_FALLTHROUGH;
24944  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24945  CYTHON_FALLTHROUGH;
24946  case 0: break;
24947  default: goto __pyx_L5_argtuple_error;
24948  }
24949  kw_args = PyDict_Size(__pyx_kwds);
24950  switch (pos_args) {
24951  case 0:
24952  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
24953  else goto __pyx_L5_argtuple_error;
24954  CYTHON_FALLTHROUGH;
24955  case 1:
24956  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
24957  else {
24958  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
24959  }
24960  CYTHON_FALLTHROUGH;
24961  case 2:
24962  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
24963  else {
24964  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
24965  }
24966  }
24967  if (unlikely(kw_args > 0)) {
24968  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
24969  }
24970  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
24971  goto __pyx_L5_argtuple_error;
24972  } else {
24973  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24974  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24975  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24976  }
24977  __pyx_v___pyx_type = values[0];
24978  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
24979  __pyx_v___pyx_state = values[2];
24980  }
24981  goto __pyx_L4_argument_unpacking_done;
24982  __pyx_L5_argtuple_error:;
24983  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
24984  __pyx_L3_error:;
24985  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
24986  __Pyx_RefNannyFinishContext();
24987  return NULL;
24988  __pyx_L4_argument_unpacking_done:;
24989  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
24990 
24991  /* function exit code */
24992  __Pyx_RefNannyFinishContext();
24993  return __pyx_r;
24994 }
24995 
24996 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
24997  PyObject *__pyx_v___pyx_PickleError = 0;
24998  PyObject *__pyx_v___pyx_result = 0;
24999  PyObject *__pyx_r = NULL;
25000  __Pyx_TraceDeclarations
25001  __Pyx_RefNannyDeclarations
25002  int __pyx_t_1;
25003  PyObject *__pyx_t_2 = NULL;
25004  PyObject *__pyx_t_3 = NULL;
25005  PyObject *__pyx_t_4 = NULL;
25006  PyObject *__pyx_t_5 = NULL;
25007  int __pyx_t_6;
25008  int __pyx_lineno = 0;
25009  const char *__pyx_filename = NULL;
25010  int __pyx_clineno = 0;
25011  __Pyx_TraceFrameInit(__pyx_codeobj__40)
25012  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
25013  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
25014 
25015  /* "(tree fragment)":4
25016  * cdef object __pyx_PickleError
25017  * cdef object __pyx_result
25018  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
25019  * from pickle import PickleError as __pyx_PickleError
25020  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25021  */
25022  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
25023  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
25024  if (__pyx_t_1) {
25025 
25026  /* "(tree fragment)":5
25027  * cdef object __pyx_result
25028  * if __pyx_checksum != 0xb068931:
25029  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
25030  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25031  * __pyx_result = Enum.__new__(__pyx_type)
25032  */
25033  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
25034  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
25035  __Pyx_GOTREF(__pyx_t_2);
25036  __Pyx_INCREF(__pyx_n_s_PickleError);
25037  __Pyx_GIVEREF(__pyx_n_s_PickleError);
25038  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
25039  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
25040  __Pyx_GOTREF(__pyx_t_3);
25041  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25042  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
25043  __Pyx_GOTREF(__pyx_t_2);
25044  __Pyx_INCREF(__pyx_t_2);
25045  __pyx_v___pyx_PickleError = __pyx_t_2;
25046  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25047  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25048 
25049  /* "(tree fragment)":6
25050  * if __pyx_checksum != 0xb068931:
25051  * from pickle import PickleError as __pyx_PickleError
25052  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
25053  * __pyx_result = Enum.__new__(__pyx_type)
25054  * if __pyx_state is not None:
25055  */
25056  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
25057  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
25058  __Pyx_GOTREF(__pyx_t_2);
25059  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
25060  __Pyx_GOTREF(__pyx_t_4);
25061  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25062  __Pyx_INCREF(__pyx_v___pyx_PickleError);
25063  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
25064  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
25065  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
25066  if (likely(__pyx_t_5)) {
25067  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
25068  __Pyx_INCREF(__pyx_t_5);
25069  __Pyx_INCREF(function);
25070  __Pyx_DECREF_SET(__pyx_t_2, function);
25071  }
25072  }
25073  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
25074  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25075  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25076  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
25077  __Pyx_GOTREF(__pyx_t_3);
25078  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25079  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25080  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25081  __PYX_ERR(1, 6, __pyx_L1_error)
25082 
25083  /* "(tree fragment)":4
25084  * cdef object __pyx_PickleError
25085  * cdef object __pyx_result
25086  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
25087  * from pickle import PickleError as __pyx_PickleError
25088  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25089  */
25090  }
25091 
25092  /* "(tree fragment)":7
25093  * from pickle import PickleError as __pyx_PickleError
25094  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25095  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
25096  * if __pyx_state is not None:
25097  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25098  */
25099  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
25100  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
25101  __Pyx_GOTREF(__pyx_t_2);
25102  __pyx_t_4 = NULL;
25103  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
25104  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
25105  if (likely(__pyx_t_4)) {
25106  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
25107  __Pyx_INCREF(__pyx_t_4);
25108  __Pyx_INCREF(function);
25109  __Pyx_DECREF_SET(__pyx_t_2, function);
25110  }
25111  }
25112  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
25113  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25114  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
25115  __Pyx_GOTREF(__pyx_t_3);
25116  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25117  __pyx_v___pyx_result = __pyx_t_3;
25118  __pyx_t_3 = 0;
25119 
25120  /* "(tree fragment)":8
25121  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25122  * __pyx_result = Enum.__new__(__pyx_type)
25123  * if __pyx_state is not None: # <<<<<<<<<<<<<<
25124  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25125  * return __pyx_result
25126  */
25127  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
25128  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
25129  __pyx_t_6 = (__pyx_t_1 != 0);
25130  if (__pyx_t_6) {
25131 
25132  /* "(tree fragment)":9
25133  * __pyx_result = Enum.__new__(__pyx_type)
25134  * if __pyx_state is not None:
25135  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
25136  * return __pyx_result
25137  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25138  */
25139  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
25140  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
25141  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
25142  __Pyx_GOTREF(__pyx_t_3);
25143  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25144 
25145  /* "(tree fragment)":8
25146  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25147  * __pyx_result = Enum.__new__(__pyx_type)
25148  * if __pyx_state is not None: # <<<<<<<<<<<<<<
25149  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25150  * return __pyx_result
25151  */
25152  }
25153 
25154  /* "(tree fragment)":10
25155  * if __pyx_state is not None:
25156  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25157  * return __pyx_result # <<<<<<<<<<<<<<
25158  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25159  * __pyx_result.name = __pyx_state[0]
25160  */
25161  __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
25162  __Pyx_XDECREF(__pyx_r);
25163  __Pyx_INCREF(__pyx_v___pyx_result);
25164  __pyx_r = __pyx_v___pyx_result;
25165  goto __pyx_L0;
25166 
25167  /* "(tree fragment)":1
25168  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
25169  * cdef object __pyx_PickleError
25170  * cdef object __pyx_result
25171  */
25172 
25173  /* function exit code */
25174  __pyx_L1_error:;
25175  __Pyx_XDECREF(__pyx_t_2);
25176  __Pyx_XDECREF(__pyx_t_3);
25177  __Pyx_XDECREF(__pyx_t_4);
25178  __Pyx_XDECREF(__pyx_t_5);
25179  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25180  __pyx_r = NULL;
25181  __pyx_L0:;
25182  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
25183  __Pyx_XDECREF(__pyx_v___pyx_result);
25184  __Pyx_XGIVEREF(__pyx_r);
25185  __Pyx_TraceReturn(__pyx_r, 0);
25186  __Pyx_RefNannyFinishContext();
25187  return __pyx_r;
25188 }
25189 
25190 /* "(tree fragment)":11
25191  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25192  * return __pyx_result
25193  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
25194  * __pyx_result.name = __pyx_state[0]
25195  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25196  */
25197 
25198 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
25199  PyObject *__pyx_r = NULL;
25200  __Pyx_TraceDeclarations
25201  __Pyx_RefNannyDeclarations
25202  PyObject *__pyx_t_1 = NULL;
25203  int __pyx_t_2;
25204  Py_ssize_t __pyx_t_3;
25205  int __pyx_t_4;
25206  int __pyx_t_5;
25207  PyObject *__pyx_t_6 = NULL;
25208  PyObject *__pyx_t_7 = NULL;
25209  PyObject *__pyx_t_8 = NULL;
25210  int __pyx_lineno = 0;
25211  const char *__pyx_filename = NULL;
25212  int __pyx_clineno = 0;
25213  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
25214  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
25215 
25216  /* "(tree fragment)":12
25217  * return __pyx_result
25218  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25219  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
25220  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25221  * __pyx_result.__dict__.update(__pyx_state[1])
25222  */
25223  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
25224  if (unlikely(__pyx_v___pyx_state == Py_None)) {
25225  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25226  __PYX_ERR(1, 12, __pyx_L1_error)
25227  }
25228  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
25229  __Pyx_GOTREF(__pyx_t_1);
25230  __Pyx_GIVEREF(__pyx_t_1);
25231  __Pyx_GOTREF(__pyx_v___pyx_result->name);
25232  __Pyx_DECREF(__pyx_v___pyx_result->name);
25233  __pyx_v___pyx_result->name = __pyx_t_1;
25234  __pyx_t_1 = 0;
25235 
25236  /* "(tree fragment)":13
25237  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25238  * __pyx_result.name = __pyx_state[0]
25239  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
25240  * __pyx_result.__dict__.update(__pyx_state[1])
25241  */
25242  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
25243  if (unlikely(__pyx_v___pyx_state == Py_None)) {
25244  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
25245  __PYX_ERR(1, 13, __pyx_L1_error)
25246  }
25247  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25248  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
25249  if (__pyx_t_4) {
25250  } else {
25251  __pyx_t_2 = __pyx_t_4;
25252  goto __pyx_L4_bool_binop_done;
25253  }
25254  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
25255  __pyx_t_5 = (__pyx_t_4 != 0);
25256  __pyx_t_2 = __pyx_t_5;
25257  __pyx_L4_bool_binop_done:;
25258  if (__pyx_t_2) {
25259 
25260  /* "(tree fragment)":14
25261  * __pyx_result.name = __pyx_state[0]
25262  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25263  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
25264  */
25265  __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
25266  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25267  __Pyx_GOTREF(__pyx_t_6);
25268  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
25269  __Pyx_GOTREF(__pyx_t_7);
25270  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25271  if (unlikely(__pyx_v___pyx_state == Py_None)) {
25272  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25273  __PYX_ERR(1, 14, __pyx_L1_error)
25274  }
25275  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
25276  __Pyx_GOTREF(__pyx_t_6);
25277  __pyx_t_8 = NULL;
25278  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
25279  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
25280  if (likely(__pyx_t_8)) {
25281  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
25282  __Pyx_INCREF(__pyx_t_8);
25283  __Pyx_INCREF(function);
25284  __Pyx_DECREF_SET(__pyx_t_7, function);
25285  }
25286  }
25287  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
25288  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
25289  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25290  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
25291  __Pyx_GOTREF(__pyx_t_1);
25292  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25293  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25294 
25295  /* "(tree fragment)":13
25296  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25297  * __pyx_result.name = __pyx_state[0]
25298  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
25299  * __pyx_result.__dict__.update(__pyx_state[1])
25300  */
25301  }
25302 
25303  /* "(tree fragment)":11
25304  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25305  * return __pyx_result
25306  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
25307  * __pyx_result.name = __pyx_state[0]
25308  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25309  */
25310 
25311  /* function exit code */
25312  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25313  goto __pyx_L0;
25314  __pyx_L1_error:;
25315  __Pyx_XDECREF(__pyx_t_1);
25316  __Pyx_XDECREF(__pyx_t_6);
25317  __Pyx_XDECREF(__pyx_t_7);
25318  __Pyx_XDECREF(__pyx_t_8);
25319  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
25320  __pyx_r = 0;
25321  __pyx_L0:;
25322  __Pyx_XGIVEREF(__pyx_r);
25323  __Pyx_TraceReturn(__pyx_r, 0);
25324  __Pyx_RefNannyFinishContext();
25325  return __pyx_r;
25326 }
25327 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25328 
25329 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyTypeObject *t, PyObject *a, PyObject *k) {
25330  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p;
25331  PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
25332  if (unlikely(!o)) return 0;
25333  p = ((struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o);
25334  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
25335  p->A_csr = Py_None; Py_INCREF(Py_None);
25336  p->B_csr = Py_None; Py_INCREF(Py_None);
25337  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25338  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25339  p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25340  p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25341  if (unlikely(__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_1__cinit__(o, a, k) < 0)) goto bad;
25342  return o;
25343  bad:
25344  Py_DECREF(o); o = 0;
25345  return NULL;
25346 }
25347 
25348 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25349  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25350  #if CYTHON_USE_TP_FINALIZE
25351  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25352  if (PyObject_CallFinalizerFromDealloc(o)) return;
25353  }
25354  #endif
25355  PyObject_GC_UnTrack(o);
25356  Py_CLEAR(p->A_csr);
25357  Py_CLEAR(p->B_csr);
25358  Py_CLEAR(p->A_indices_copy);
25359  Py_CLEAR(p->A_index_pointer_copy);
25360  Py_CLEAR(p->B_indices_copy);
25361  Py_CLEAR(p->B_index_pointer_copy);
25362  PyObject_GC_Track(o);
25363  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25364 }
25365 
25366 static int __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o, visitproc v, void *a) {
25367  int e;
25368  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25369  e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction)); if (e) return e;
25370  if (p->A_csr) {
25371  e = (*v)(p->A_csr, a); if (e) return e;
25372  }
25373  if (p->B_csr) {
25374  e = (*v)(p->B_csr, a); if (e) return e;
25375  }
25376  if (p->A_indices_copy) {
25377  e = (*v)(p->A_indices_copy, a); if (e) return e;
25378  }
25379  if (p->A_index_pointer_copy) {
25380  e = (*v)(p->A_index_pointer_copy, a); if (e) return e;
25381  }
25382  if (p->B_indices_copy) {
25383  e = (*v)(p->B_indices_copy, a); if (e) return e;
25384  }
25385  if (p->B_index_pointer_copy) {
25386  e = (*v)(p->B_index_pointer_copy, a); if (e) return e;
25387  }
25388  return 0;
25389 }
25390 
25391 static int __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction(PyObject *o) {
25392  PyObject* tmp;
25393  struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *p = (struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction *)o;
25394  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) { if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
25395  tmp = ((PyObject*)p->A_csr);
25396  p->A_csr = Py_None; Py_INCREF(Py_None);
25397  Py_XDECREF(tmp);
25398  tmp = ((PyObject*)p->B_csr);
25399  p->B_csr = Py_None; Py_INCREF(Py_None);
25400  Py_XDECREF(tmp);
25401  tmp = ((PyObject*)p->A_indices_copy);
25402  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
25403  Py_XDECREF(tmp);
25404  tmp = ((PyObject*)p->A_index_pointer_copy);
25405  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25406  Py_XDECREF(tmp);
25407  tmp = ((PyObject*)p->B_indices_copy);
25408  p->B_indices_copy = Py_None; Py_INCREF(Py_None);
25409  Py_XDECREF(tmp);
25410  tmp = ((PyObject*)p->B_index_pointer_copy);
25411  p->B_index_pointer_copy = Py_None; Py_INCREF(Py_None);
25412  Py_XDECREF(tmp);
25413  return 0;
25414 }
25415 
25416 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction[] = {
25417  {"set_dense_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_2set_dense_matrix_float},
25418  {"set_dense_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_4set_dense_matrix_double},
25419  {"set_dense_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_6set_dense_matrix_long_double},
25420  {"set_csr_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_8set_csr_matrix_float},
25421  {"set_csr_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_10set_csr_matrix_double},
25422  {"set_csr_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_12set_csr_matrix_long_double},
25423  {"set_csc_matrix_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_14set_csc_matrix_float},
25424  {"set_csc_matrix_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_16set_csc_matrix_double},
25425  {"set_csc_matrix_long_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_18set_csc_matrix_long_double},
25426  {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_20__reduce_cython__},
25427  {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_22__setstate_cython__},
25428  {0, 0, 0, 0}
25429 };
25430 
25431 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = {
25432  PyVarObject_HEAD_INIT(0, 0)
25433  "imate._c_linear_operator.py_c_affine_matrix_function.pycAffineMatrixFunction", /*tp_name*/
25434  sizeof(struct __pyx_obj_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction), /*tp_basicsize*/
25435  0, /*tp_itemsize*/
25436  __pyx_tp_dealloc_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_dealloc*/
25437  #if PY_VERSION_HEX < 0x030800b4
25438  0, /*tp_print*/
25439  #endif
25440  #if PY_VERSION_HEX >= 0x030800b4
25441  0, /*tp_vectorcall_offset*/
25442  #endif
25443  0, /*tp_getattr*/
25444  0, /*tp_setattr*/
25445  #if PY_MAJOR_VERSION < 3
25446  0, /*tp_compare*/
25447  #endif
25448  #if PY_MAJOR_VERSION >= 3
25449  0, /*tp_as_async*/
25450  #endif
25451  0, /*tp_repr*/
25452  0, /*tp_as_number*/
25453  0, /*tp_as_sequence*/
25454  0, /*tp_as_mapping*/
25455  0, /*tp_hash*/
25456  0, /*tp_call*/
25457  0, /*tp_str*/
25458  0, /*tp_getattro*/
25459  0, /*tp_setattro*/
25460  0, /*tp_as_buffer*/
25461  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25462  "\n Defines a linear operator that is an affine function of a single parameter.\n Given two matrices :math:`\\mathbf{A}` and :math:`\\mathf{B}`, the linear\n operator is defined by\n\n .. math::\n\n \\mathbf{A}(t) = \\mathbf{A} + t \\mathbf{B},\n\n where :math:`t \\in \\mathbb{R}` is a parameter.\n\n **Initializing Object:**\n\n The matrices :math:`\\mathbf{A}` and :math:`\\mathbf{B}` are given at the\n initialization of the object. These matrices can be a dense matrix as 2D\n numpy arrays, or sparse matrices of any format (CSR, CSC, etc) using scipy\n sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrices of CSR format. Note the format of the input matrices\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n >>> B = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n\n The following is an example of defining the operator with dense matrices:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = numpy.random.randn((n, m), dtype=float)\n >>> B = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator ""cimport AffineMatrixFunction\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, B)\n\n If the matrix ``B`` is not given, or if it is ``None``, or if it is ``0``,\n then the linear operator assumes ``B`` is zero matrix. For example:\n\n .. code-block:: python\n\n # Case 1: Not providing B\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A)\n\n # Case 2: Setting B to None\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, None)\n\n # Case 3: Setting B to scalar zero\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 0)\n\n If the matrix ``B`` is set to the scalar ``1``, the linear operator assumes\n that ``B`` is the identity matrix. For example:\n\n .. code-block:: python\n\n >>> cdef AffineMatrixFunction Aop = AffineMatrixFunction(A, 1)\n\n **Setting the Parameter:**\n\n The parameter :math:`t` is given to the object ``Aop`` at **runtime** using\n :func:`set_parameters` function.\n\n .. note::\n\n Setting the parameter using :func:`set_parameter` does not require\n python's GIL, hence, the parameter can be set in ``nogil`` environment,\n if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> cdef double t = 1.0\n\n >>> # nogil environment is optional\n >>> with nogil:\n ... Aop.set_parameters(&t)\n\n Note that a *pointer* to the parameter should be provided to the function.\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do not require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n""\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`Matrix`\n ", /*tp_doc*/
25463  __pyx_tp_traverse_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_traverse*/
25464  __pyx_tp_clear_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_clear*/
25465  0, /*tp_richcompare*/
25466  0, /*tp_weaklistoffset*/
25467  0, /*tp_iter*/
25468  0, /*tp_iternext*/
25469  __pyx_methods_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_methods*/
25470  0, /*tp_members*/
25471  0, /*tp_getset*/
25472  0, /*tp_base*/
25473  0, /*tp_dict*/
25474  0, /*tp_descr_get*/
25475  0, /*tp_descr_set*/
25476  0, /*tp_dictoffset*/
25477  0, /*tp_init*/
25478  0, /*tp_alloc*/
25479  __pyx_tp_new_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction, /*tp_new*/
25480  0, /*tp_free*/
25481  0, /*tp_is_gc*/
25482  0, /*tp_bases*/
25483  0, /*tp_mro*/
25484  0, /*tp_cache*/
25485  0, /*tp_subclasses*/
25486  0, /*tp_weaklist*/
25487  0, /*tp_del*/
25488  0, /*tp_version_tag*/
25489  #if PY_VERSION_HEX >= 0x030400a1
25490  0, /*tp_finalize*/
25491  #endif
25492  #if PY_VERSION_HEX >= 0x030800b1
25493  0, /*tp_vectorcall*/
25494  #endif
25495  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25496  0, /*tp_print*/
25497  #endif
25498 };
25499 static struct __pyx_vtabstruct_array __pyx_vtable_array;
25500 
25501 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25502  struct __pyx_array_obj *p;
25503  PyObject *o;
25504  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25505  o = (*t->tp_alloc)(t, 0);
25506  } else {
25507  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25508  }
25509  if (unlikely(!o)) return 0;
25510  p = ((struct __pyx_array_obj *)o);
25511  p->__pyx_vtab = __pyx_vtabptr_array;
25512  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25513  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25514  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
25515  return o;
25516  bad:
25517  Py_DECREF(o); o = 0;
25518  return NULL;
25519 }
25520 
25521 static void __pyx_tp_dealloc_array(PyObject *o) {
25522  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25523  #if CYTHON_USE_TP_FINALIZE
25524  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
25525  if (PyObject_CallFinalizerFromDealloc(o)) return;
25526  }
25527  #endif
25528  {
25529  PyObject *etype, *eval, *etb;
25530  PyErr_Fetch(&etype, &eval, &etb);
25531  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25532  __pyx_array___dealloc__(o);
25533  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25534  PyErr_Restore(etype, eval, etb);
25535  }
25536  Py_CLEAR(p->mode);
25537  Py_CLEAR(p->_format);
25538  (*Py_TYPE(o)->tp_free)(o);
25539 }
25540 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25541  PyObject *r;
25542  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25543  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25544  Py_DECREF(x);
25545  return r;
25546 }
25547 
25548 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25549  if (v) {
25550  return __pyx_array___setitem__(o, i, v);
25551  }
25552  else {
25553  PyErr_Format(PyExc_NotImplementedError,
25554  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
25555  return -1;
25556  }
25557 }
25558 
25559 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25560  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25561  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25562  PyErr_Clear();
25563  v = __pyx_array___getattr__(o, n);
25564  }
25565  return v;
25566 }
25567 
25568 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25569  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25570 }
25571 
25572 static PyMethodDef __pyx_methods_array[] = {
25573  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25574  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
25575  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
25576  {0, 0, 0, 0}
25577 };
25578 
25579 static struct PyGetSetDef __pyx_getsets_array[] = {
25580  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
25581  {0, 0, 0, 0, 0}
25582 };
25583 
25584 static PySequenceMethods __pyx_tp_as_sequence_array = {
25585  __pyx_array___len__, /*sq_length*/
25586  0, /*sq_concat*/
25587  0, /*sq_repeat*/
25588  __pyx_sq_item_array, /*sq_item*/
25589  0, /*sq_slice*/
25590  0, /*sq_ass_item*/
25591  0, /*sq_ass_slice*/
25592  0, /*sq_contains*/
25593  0, /*sq_inplace_concat*/
25594  0, /*sq_inplace_repeat*/
25595 };
25596 
25597 static PyMappingMethods __pyx_tp_as_mapping_array = {
25598  __pyx_array___len__, /*mp_length*/
25599  __pyx_array___getitem__, /*mp_subscript*/
25600  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
25601 };
25602 
25603 static PyBufferProcs __pyx_tp_as_buffer_array = {
25604  #if PY_MAJOR_VERSION < 3
25605  0, /*bf_getreadbuffer*/
25606  #endif
25607  #if PY_MAJOR_VERSION < 3
25608  0, /*bf_getwritebuffer*/
25609  #endif
25610  #if PY_MAJOR_VERSION < 3
25611  0, /*bf_getsegcount*/
25612  #endif
25613  #if PY_MAJOR_VERSION < 3
25614  0, /*bf_getcharbuffer*/
25615  #endif
25616  __pyx_array_getbuffer, /*bf_getbuffer*/
25617  0, /*bf_releasebuffer*/
25618 };
25619 
25620 static PyTypeObject __pyx_type___pyx_array = {
25621  PyVarObject_HEAD_INIT(0, 0)
25622  "imate._c_linear_operator.py_c_affine_matrix_function.array", /*tp_name*/
25623  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
25624  0, /*tp_itemsize*/
25625  __pyx_tp_dealloc_array, /*tp_dealloc*/
25626  #if PY_VERSION_HEX < 0x030800b4
25627  0, /*tp_print*/
25628  #endif
25629  #if PY_VERSION_HEX >= 0x030800b4
25630  0, /*tp_vectorcall_offset*/
25631  #endif
25632  0, /*tp_getattr*/
25633  0, /*tp_setattr*/
25634  #if PY_MAJOR_VERSION < 3
25635  0, /*tp_compare*/
25636  #endif
25637  #if PY_MAJOR_VERSION >= 3
25638  0, /*tp_as_async*/
25639  #endif
25640  0, /*tp_repr*/
25641  0, /*tp_as_number*/
25642  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
25643  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
25644  0, /*tp_hash*/
25645  0, /*tp_call*/
25646  0, /*tp_str*/
25647  __pyx_tp_getattro_array, /*tp_getattro*/
25648  0, /*tp_setattro*/
25649  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
25650  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
25651  0, /*tp_doc*/
25652  0, /*tp_traverse*/
25653  0, /*tp_clear*/
25654  0, /*tp_richcompare*/
25655  0, /*tp_weaklistoffset*/
25656  0, /*tp_iter*/
25657  0, /*tp_iternext*/
25658  __pyx_methods_array, /*tp_methods*/
25659  0, /*tp_members*/
25660  __pyx_getsets_array, /*tp_getset*/
25661  0, /*tp_base*/
25662  0, /*tp_dict*/
25663  0, /*tp_descr_get*/
25664  0, /*tp_descr_set*/
25665  0, /*tp_dictoffset*/
25666  0, /*tp_init*/
25667  0, /*tp_alloc*/
25668  __pyx_tp_new_array, /*tp_new*/
25669  0, /*tp_free*/
25670  0, /*tp_is_gc*/
25671  0, /*tp_bases*/
25672  0, /*tp_mro*/
25673  0, /*tp_cache*/
25674  0, /*tp_subclasses*/
25675  0, /*tp_weaklist*/
25676  0, /*tp_del*/
25677  0, /*tp_version_tag*/
25678  #if PY_VERSION_HEX >= 0x030400a1
25679  0, /*tp_finalize*/
25680  #endif
25681  #if PY_VERSION_HEX >= 0x030800b1
25682  0, /*tp_vectorcall*/
25683  #endif
25684  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25685  0, /*tp_print*/
25686  #endif
25687 };
25688 
25689 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25690  struct __pyx_MemviewEnum_obj *p;
25691  PyObject *o;
25692  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25693  o = (*t->tp_alloc)(t, 0);
25694  } else {
25695  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25696  }
25697  if (unlikely(!o)) return 0;
25698  p = ((struct __pyx_MemviewEnum_obj *)o);
25699  p->name = Py_None; Py_INCREF(Py_None);
25700  return o;
25701 }
25702 
25703 static void __pyx_tp_dealloc_Enum(PyObject *o) {
25704  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25705  #if CYTHON_USE_TP_FINALIZE
25706  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25707  if (PyObject_CallFinalizerFromDealloc(o)) return;
25708  }
25709  #endif
25710  PyObject_GC_UnTrack(o);
25711  Py_CLEAR(p->name);
25712  (*Py_TYPE(o)->tp_free)(o);
25713 }
25714 
25715 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
25716  int e;
25717  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25718  if (p->name) {
25719  e = (*v)(p->name, a); if (e) return e;
25720  }
25721  return 0;
25722 }
25723 
25724 static int __pyx_tp_clear_Enum(PyObject *o) {
25725  PyObject* tmp;
25726  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25727  tmp = ((PyObject*)p->name);
25728  p->name = Py_None; Py_INCREF(Py_None);
25729  Py_XDECREF(tmp);
25730  return 0;
25731 }
25732 
25733 static PyMethodDef __pyx_methods_Enum[] = {
25734  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
25735  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
25736  {0, 0, 0, 0}
25737 };
25738 
25739 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25740  PyVarObject_HEAD_INIT(0, 0)
25741  "imate._c_linear_operator.py_c_affine_matrix_function.Enum", /*tp_name*/
25742  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
25743  0, /*tp_itemsize*/
25744  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
25745  #if PY_VERSION_HEX < 0x030800b4
25746  0, /*tp_print*/
25747  #endif
25748  #if PY_VERSION_HEX >= 0x030800b4
25749  0, /*tp_vectorcall_offset*/
25750  #endif
25751  0, /*tp_getattr*/
25752  0, /*tp_setattr*/
25753  #if PY_MAJOR_VERSION < 3
25754  0, /*tp_compare*/
25755  #endif
25756  #if PY_MAJOR_VERSION >= 3
25757  0, /*tp_as_async*/
25758  #endif
25759  __pyx_MemviewEnum___repr__, /*tp_repr*/
25760  0, /*tp_as_number*/
25761  0, /*tp_as_sequence*/
25762  0, /*tp_as_mapping*/
25763  0, /*tp_hash*/
25764  0, /*tp_call*/
25765  0, /*tp_str*/
25766  0, /*tp_getattro*/
25767  0, /*tp_setattro*/
25768  0, /*tp_as_buffer*/
25769  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25770  0, /*tp_doc*/
25771  __pyx_tp_traverse_Enum, /*tp_traverse*/
25772  __pyx_tp_clear_Enum, /*tp_clear*/
25773  0, /*tp_richcompare*/
25774  0, /*tp_weaklistoffset*/
25775  0, /*tp_iter*/
25776  0, /*tp_iternext*/
25777  __pyx_methods_Enum, /*tp_methods*/
25778  0, /*tp_members*/
25779  0, /*tp_getset*/
25780  0, /*tp_base*/
25781  0, /*tp_dict*/
25782  0, /*tp_descr_get*/
25783  0, /*tp_descr_set*/
25784  0, /*tp_dictoffset*/
25785  __pyx_MemviewEnum___init__, /*tp_init*/
25786  0, /*tp_alloc*/
25787  __pyx_tp_new_Enum, /*tp_new*/
25788  0, /*tp_free*/
25789  0, /*tp_is_gc*/
25790  0, /*tp_bases*/
25791  0, /*tp_mro*/
25792  0, /*tp_cache*/
25793  0, /*tp_subclasses*/
25794  0, /*tp_weaklist*/
25795  0, /*tp_del*/
25796  0, /*tp_version_tag*/
25797  #if PY_VERSION_HEX >= 0x030400a1
25798  0, /*tp_finalize*/
25799  #endif
25800  #if PY_VERSION_HEX >= 0x030800b1
25801  0, /*tp_vectorcall*/
25802  #endif
25803  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25804  0, /*tp_print*/
25805  #endif
25806 };
25807 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
25808 
25809 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
25810  struct __pyx_memoryview_obj *p;
25811  PyObject *o;
25812  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25813  o = (*t->tp_alloc)(t, 0);
25814  } else {
25815  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25816  }
25817  if (unlikely(!o)) return 0;
25818  p = ((struct __pyx_memoryview_obj *)o);
25819  p->__pyx_vtab = __pyx_vtabptr_memoryview;
25820  p->obj = Py_None; Py_INCREF(Py_None);
25821  p->_size = Py_None; Py_INCREF(Py_None);
25822  p->_array_interface = Py_None; Py_INCREF(Py_None);
25823  p->view.obj = NULL;
25824  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
25825  return o;
25826  bad:
25827  Py_DECREF(o); o = 0;
25828  return NULL;
25829 }
25830 
25831 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
25832  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25833  #if CYTHON_USE_TP_FINALIZE
25834  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25835  if (PyObject_CallFinalizerFromDealloc(o)) return;
25836  }
25837  #endif
25838  PyObject_GC_UnTrack(o);
25839  {
25840  PyObject *etype, *eval, *etb;
25841  PyErr_Fetch(&etype, &eval, &etb);
25842  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25843  __pyx_memoryview___dealloc__(o);
25844  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25845  PyErr_Restore(etype, eval, etb);
25846  }
25847  Py_CLEAR(p->obj);
25848  Py_CLEAR(p->_size);
25849  Py_CLEAR(p->_array_interface);
25850  (*Py_TYPE(o)->tp_free)(o);
25851 }
25852 
25853 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
25854  int e;
25855  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25856  if (p->obj) {
25857  e = (*v)(p->obj, a); if (e) return e;
25858  }
25859  if (p->_size) {
25860  e = (*v)(p->_size, a); if (e) return e;
25861  }
25862  if (p->_array_interface) {
25863  e = (*v)(p->_array_interface, a); if (e) return e;
25864  }
25865  if (p->view.obj) {
25866  e = (*v)(p->view.obj, a); if (e) return e;
25867  }
25868  return 0;
25869 }
25870 
25871 static int __pyx_tp_clear_memoryview(PyObject *o) {
25872  PyObject* tmp;
25873  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25874  tmp = ((PyObject*)p->obj);
25875  p->obj = Py_None; Py_INCREF(Py_None);
25876  Py_XDECREF(tmp);
25877  tmp = ((PyObject*)p->_size);
25878  p->_size = Py_None; Py_INCREF(Py_None);
25879  Py_XDECREF(tmp);
25880  tmp = ((PyObject*)p->_array_interface);
25881  p->_array_interface = Py_None; Py_INCREF(Py_None);
25882  Py_XDECREF(tmp);
25883  Py_CLEAR(p->view.obj);
25884  return 0;
25885 }
25886 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
25887  PyObject *r;
25888  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25889  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25890  Py_DECREF(x);
25891  return r;
25892 }
25893 
25894 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
25895  if (v) {
25896  return __pyx_memoryview___setitem__(o, i, v);
25897  }
25898  else {
25899  PyErr_Format(PyExc_NotImplementedError,
25900  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
25901  return -1;
25902  }
25903 }
25904 
25905 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
25906  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
25907 }
25908 
25909 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
25910  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
25911 }
25912 
25913 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
25914  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
25915 }
25916 
25917 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
25918  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
25919 }
25920 
25921 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
25922  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
25923 }
25924 
25925 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
25926  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
25927 }
25928 
25929 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
25930  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
25931 }
25932 
25933 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
25934  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
25935 }
25936 
25937 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
25938  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
25939 }
25940 
25941 static PyMethodDef __pyx_methods_memoryview[] = {
25942  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
25943  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
25944  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
25945  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
25946  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
25947  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
25948  {0, 0, 0, 0}
25949 };
25950 
25951 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
25952  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
25953  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
25954  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
25955  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
25956  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
25957  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
25958  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
25959  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
25960  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
25961  {0, 0, 0, 0, 0}
25962 };
25963 
25964 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
25965  __pyx_memoryview___len__, /*sq_length*/
25966  0, /*sq_concat*/
25967  0, /*sq_repeat*/
25968  __pyx_sq_item_memoryview, /*sq_item*/
25969  0, /*sq_slice*/
25970  0, /*sq_ass_item*/
25971  0, /*sq_ass_slice*/
25972  0, /*sq_contains*/
25973  0, /*sq_inplace_concat*/
25974  0, /*sq_inplace_repeat*/
25975 };
25976 
25977 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
25978  __pyx_memoryview___len__, /*mp_length*/
25979  __pyx_memoryview___getitem__, /*mp_subscript*/
25980  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
25981 };
25982 
25983 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25984  #if PY_MAJOR_VERSION < 3
25985  0, /*bf_getreadbuffer*/
25986  #endif
25987  #if PY_MAJOR_VERSION < 3
25988  0, /*bf_getwritebuffer*/
25989  #endif
25990  #if PY_MAJOR_VERSION < 3
25991  0, /*bf_getsegcount*/
25992  #endif
25993  #if PY_MAJOR_VERSION < 3
25994  0, /*bf_getcharbuffer*/
25995  #endif
25996  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
25997  0, /*bf_releasebuffer*/
25998 };
25999 
26000 static PyTypeObject __pyx_type___pyx_memoryview = {
26001  PyVarObject_HEAD_INIT(0, 0)
26002  "imate._c_linear_operator.py_c_affine_matrix_function.memoryview", /*tp_name*/
26003  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
26004  0, /*tp_itemsize*/
26005  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
26006  #if PY_VERSION_HEX < 0x030800b4
26007  0, /*tp_print*/
26008  #endif
26009  #if PY_VERSION_HEX >= 0x030800b4
26010  0, /*tp_vectorcall_offset*/
26011  #endif
26012  0, /*tp_getattr*/
26013  0, /*tp_setattr*/
26014  #if PY_MAJOR_VERSION < 3
26015  0, /*tp_compare*/
26016  #endif
26017  #if PY_MAJOR_VERSION >= 3
26018  0, /*tp_as_async*/
26019  #endif
26020  __pyx_memoryview___repr__, /*tp_repr*/
26021  0, /*tp_as_number*/
26022  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
26023  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
26024  0, /*tp_hash*/
26025  0, /*tp_call*/
26026  __pyx_memoryview___str__, /*tp_str*/
26027  0, /*tp_getattro*/
26028  0, /*tp_setattro*/
26029  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
26030  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26031  0, /*tp_doc*/
26032  __pyx_tp_traverse_memoryview, /*tp_traverse*/
26033  __pyx_tp_clear_memoryview, /*tp_clear*/
26034  0, /*tp_richcompare*/
26035  0, /*tp_weaklistoffset*/
26036  0, /*tp_iter*/
26037  0, /*tp_iternext*/
26038  __pyx_methods_memoryview, /*tp_methods*/
26039  0, /*tp_members*/
26040  __pyx_getsets_memoryview, /*tp_getset*/
26041  0, /*tp_base*/
26042  0, /*tp_dict*/
26043  0, /*tp_descr_get*/
26044  0, /*tp_descr_set*/
26045  0, /*tp_dictoffset*/
26046  0, /*tp_init*/
26047  0, /*tp_alloc*/
26048  __pyx_tp_new_memoryview, /*tp_new*/
26049  0, /*tp_free*/
26050  0, /*tp_is_gc*/
26051  0, /*tp_bases*/
26052  0, /*tp_mro*/
26053  0, /*tp_cache*/
26054  0, /*tp_subclasses*/
26055  0, /*tp_weaklist*/
26056  0, /*tp_del*/
26057  0, /*tp_version_tag*/
26058  #if PY_VERSION_HEX >= 0x030400a1
26059  0, /*tp_finalize*/
26060  #endif
26061  #if PY_VERSION_HEX >= 0x030800b1
26062  0, /*tp_vectorcall*/
26063  #endif
26064  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26065  0, /*tp_print*/
26066  #endif
26067 };
26068 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26069 
26070 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26071  struct __pyx_memoryviewslice_obj *p;
26072  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
26073  if (unlikely(!o)) return 0;
26074  p = ((struct __pyx_memoryviewslice_obj *)o);
26075  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26076  p->from_object = Py_None; Py_INCREF(Py_None);
26077  p->from_slice.memview = NULL;
26078  return o;
26079 }
26080 
26081 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26082  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26083  #if CYTHON_USE_TP_FINALIZE
26084  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
26085  if (PyObject_CallFinalizerFromDealloc(o)) return;
26086  }
26087  #endif
26088  PyObject_GC_UnTrack(o);
26089  {
26090  PyObject *etype, *eval, *etb;
26091  PyErr_Fetch(&etype, &eval, &etb);
26092  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26093  __pyx_memoryviewslice___dealloc__(o);
26094  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26095  PyErr_Restore(etype, eval, etb);
26096  }
26097  Py_CLEAR(p->from_object);
26098  PyObject_GC_Track(o);
26099  __pyx_tp_dealloc_memoryview(o);
26100 }
26101 
26102 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26103  int e;
26104  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26105  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26106  if (p->from_object) {
26107  e = (*v)(p->from_object, a); if (e) return e;
26108  }
26109  return 0;
26110 }
26111 
26112 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26113  PyObject* tmp;
26114  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26115  __pyx_tp_clear_memoryview(o);
26116  tmp = ((PyObject*)p->from_object);
26117  p->from_object = Py_None; Py_INCREF(Py_None);
26118  Py_XDECREF(tmp);
26119  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
26120  return 0;
26121 }
26122 
26123 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
26124  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
26125 }
26126 
26127 static PyMethodDef __pyx_methods__memoryviewslice[] = {
26128  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
26129  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
26130  {0, 0, 0, 0}
26131 };
26132 
26133 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
26134  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
26135  {0, 0, 0, 0, 0}
26136 };
26137 
26138 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26139  PyVarObject_HEAD_INIT(0, 0)
26140  "imate._c_linear_operator.py_c_affine_matrix_function._memoryviewslice", /*tp_name*/
26141  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26142  0, /*tp_itemsize*/
26143  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26144  #if PY_VERSION_HEX < 0x030800b4
26145  0, /*tp_print*/
26146  #endif
26147  #if PY_VERSION_HEX >= 0x030800b4
26148  0, /*tp_vectorcall_offset*/
26149  #endif
26150  0, /*tp_getattr*/
26151  0, /*tp_setattr*/
26152  #if PY_MAJOR_VERSION < 3
26153  0, /*tp_compare*/
26154  #endif
26155  #if PY_MAJOR_VERSION >= 3
26156  0, /*tp_as_async*/
26157  #endif
26158  #if CYTHON_COMPILING_IN_PYPY
26159  __pyx_memoryview___repr__, /*tp_repr*/
26160  #else
26161  0, /*tp_repr*/
26162  #endif
26163  0, /*tp_as_number*/
26164  0, /*tp_as_sequence*/
26165  0, /*tp_as_mapping*/
26166  0, /*tp_hash*/
26167  0, /*tp_call*/
26168  #if CYTHON_COMPILING_IN_PYPY
26169  __pyx_memoryview___str__, /*tp_str*/
26170  #else
26171  0, /*tp_str*/
26172  #endif
26173  0, /*tp_getattro*/
26174  0, /*tp_setattro*/
26175  0, /*tp_as_buffer*/
26176  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26177  "Internal class for passing memoryview slices to Python", /*tp_doc*/
26178  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26179  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26180  0, /*tp_richcompare*/
26181  0, /*tp_weaklistoffset*/
26182  0, /*tp_iter*/
26183  0, /*tp_iternext*/
26184  __pyx_methods__memoryviewslice, /*tp_methods*/
26185  0, /*tp_members*/
26186  __pyx_getsets__memoryviewslice, /*tp_getset*/
26187  0, /*tp_base*/
26188  0, /*tp_dict*/
26189  0, /*tp_descr_get*/
26190  0, /*tp_descr_set*/
26191  0, /*tp_dictoffset*/
26192  0, /*tp_init*/
26193  0, /*tp_alloc*/
26194  __pyx_tp_new__memoryviewslice, /*tp_new*/
26195  0, /*tp_free*/
26196  0, /*tp_is_gc*/
26197  0, /*tp_bases*/
26198  0, /*tp_mro*/
26199  0, /*tp_cache*/
26200  0, /*tp_subclasses*/
26201  0, /*tp_weaklist*/
26202  0, /*tp_del*/
26203  0, /*tp_version_tag*/
26204  #if PY_VERSION_HEX >= 0x030400a1
26205  0, /*tp_finalize*/
26206  #endif
26207  #if PY_VERSION_HEX >= 0x030800b1
26208  0, /*tp_vectorcall*/
26209  #endif
26210  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26211  0, /*tp_print*/
26212  #endif
26213 };
26214 
26215 static PyMethodDef __pyx_methods[] = {
26216  {0, 0, 0, 0}
26217 };
26218 
26219 #if PY_MAJOR_VERSION >= 3
26220 #if CYTHON_PEP489_MULTI_PHASE_INIT
26221 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
26222 static int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject* module); /*proto*/
26223 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26224  {Py_mod_create, (void*)__pyx_pymod_create},
26225  {Py_mod_exec, (void*)__pyx_pymod_exec_py_c_affine_matrix_function},
26226  {0, NULL}
26227 };
26228 #endif
26229 
26230 static struct PyModuleDef __pyx_moduledef = {
26231  PyModuleDef_HEAD_INIT,
26232  "py_c_affine_matrix_function",
26233  0, /* m_doc */
26234  #if CYTHON_PEP489_MULTI_PHASE_INIT
26235  0, /* m_size */
26236  #else
26237  -1, /* m_size */
26238  #endif
26239  __pyx_methods /* m_methods */,
26240  #if CYTHON_PEP489_MULTI_PHASE_INIT
26241  __pyx_moduledef_slots, /* m_slots */
26242  #else
26243  NULL, /* m_reload */
26244  #endif
26245  NULL, /* m_traverse */
26246  NULL, /* m_clear */
26247  NULL /* m_free */
26248 };
26249 #endif
26250 #ifndef CYTHON_SMALL_CODE
26251 #if defined(__clang__)
26252  #define CYTHON_SMALL_CODE
26253 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26254  #define CYTHON_SMALL_CODE __attribute__((cold))
26255 #else
26256  #define CYTHON_SMALL_CODE
26257 #endif
26258 #endif
26259 
26260 static __Pyx_StringTabEntry __pyx_string_tab[] = {
26261  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
26262  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26263  {&__pyx_kp_u_A_and_B_should_have_similar_data, __pyx_k_A_and_B_should_have_similar_data, sizeof(__pyx_k_A_and_B_should_have_similar_data), 0, 1, 0, 0},
26264  {&__pyx_kp_u_A_and_B_should_have_the_same_sha, __pyx_k_A_and_B_should_have_the_same_sha, sizeof(__pyx_k_A_and_B_should_have_the_same_sha), 0, 1, 0, 0},
26265  {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None, sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
26266  {&__pyx_n_s_A_data, __pyx_k_A_data, sizeof(__pyx_k_A_data), 0, 0, 1, 1},
26267  {&__pyx_n_s_A_data_mv, __pyx_k_A_data_mv, sizeof(__pyx_k_A_data_mv), 0, 0, 1, 1},
26268  {&__pyx_n_s_A_data_mv_c, __pyx_k_A_data_mv_c, sizeof(__pyx_k_A_data_mv_c), 0, 0, 1, 1},
26269  {&__pyx_n_s_A_data_mv_f, __pyx_k_A_data_mv_f, sizeof(__pyx_k_A_data_mv_f), 0, 0, 1, 1},
26270  {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer, sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
26271  {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv, sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
26272  {&__pyx_n_s_A_indices, __pyx_k_A_indices, sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
26273  {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv, sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
26274  {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major, sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
26275  {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns, sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
26276  {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows, sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
26277  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
26278  {&__pyx_n_s_B_data, __pyx_k_B_data, sizeof(__pyx_k_B_data), 0, 0, 1, 1},
26279  {&__pyx_n_s_B_data_mv, __pyx_k_B_data_mv, sizeof(__pyx_k_B_data_mv), 0, 0, 1, 1},
26280  {&__pyx_n_s_B_data_mv_c, __pyx_k_B_data_mv_c, sizeof(__pyx_k_B_data_mv_c), 0, 0, 1, 1},
26281  {&__pyx_n_s_B_data_mv_f, __pyx_k_B_data_mv_f, sizeof(__pyx_k_B_data_mv_f), 0, 0, 1, 1},
26282  {&__pyx_n_s_B_index_pointer, __pyx_k_B_index_pointer, sizeof(__pyx_k_B_index_pointer), 0, 0, 1, 1},
26283  {&__pyx_n_s_B_index_pointer_mv, __pyx_k_B_index_pointer_mv, sizeof(__pyx_k_B_index_pointer_mv), 0, 0, 1, 1},
26284  {&__pyx_n_s_B_indices, __pyx_k_B_indices, sizeof(__pyx_k_B_indices), 0, 0, 1, 1},
26285  {&__pyx_n_s_B_indices_mv, __pyx_k_B_indices_mv, sizeof(__pyx_k_B_indices_mv), 0, 0, 1, 1},
26286  {&__pyx_n_s_B_is_identity, __pyx_k_B_is_identity, sizeof(__pyx_k_B_is_identity), 0, 0, 1, 1},
26287  {&__pyx_n_s_B_is_row_major, __pyx_k_B_is_row_major, sizeof(__pyx_k_B_is_row_major), 0, 0, 1, 1},
26288  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26289  {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
26290  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26291  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26292  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26293  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
26294  {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa, sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
26295  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26296  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26297  {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS, sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
26298  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
26299  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26300  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26301  {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen, sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
26302  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
26303  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
26304  {&__pyx_kp_u_Matrices_A_and_B_should_have_sim, __pyx_k_Matrices_A_and_B_should_have_sim, sizeof(__pyx_k_Matrices_A_and_B_should_have_sim), 0, 1, 0, 0},
26305  {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F, sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
26306  {&__pyx_kp_u_Matrix_B_should_be_either_C_or_F, __pyx_k_Matrix_B_should_be_either_C_or_F, sizeof(__pyx_k_Matrix_B_should_be_either_C_or_F), 0, 1, 0, 0},
26307  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26308  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26309  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26310  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
26311  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
26312  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26313  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26314  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26315  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26316  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26317  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26318  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
26319  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
26320  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
26321  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
26322  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
26323  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26324  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26325  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26326  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
26327  {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
26328  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
26329  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
26330  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26331  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26332  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
26333  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26334  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
26335  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
26336  {&__pyx_n_b_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 0, 1},
26337  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
26338  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
26339  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
26340  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26341  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26342  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26343  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
26344  {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices, sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
26345  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
26346  {&__pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_k_imate__c_linear_operator_py_c_af, sizeof(__pyx_k_imate__c_linear_operator_py_c_af), 0, 0, 1, 0},
26347  {&__pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_k_imate__c_linear_operator_py_c_af_2, sizeof(__pyx_k_imate__c_linear_operator_py_c_af_2), 0, 0, 1, 1},
26348  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
26349  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
26350  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
26351  {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
26352  {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc, sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
26353  {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr, sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
26354  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26355  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26356  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
26357  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
26358  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
26359  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
26360  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26361  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26362  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
26363  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26364  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26365  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
26366  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
26367  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26368  {&__pyx_n_s_pycAffineMatrixFunction, __pyx_k_pycAffineMatrixFunction, sizeof(__pyx_k_pycAffineMatrixFunction), 0, 0, 1, 1},
26369  {&__pyx_n_s_pycAffineMatrixFunction___reduce, __pyx_k_pycAffineMatrixFunction___reduce, sizeof(__pyx_k_pycAffineMatrixFunction___reduce), 0, 0, 1, 1},
26370  {&__pyx_n_s_pycAffineMatrixFunction___setsta, __pyx_k_pycAffineMatrixFunction___setsta, sizeof(__pyx_k_pycAffineMatrixFunction___setsta), 0, 0, 1, 1},
26371  {&__pyx_n_s_pycAffineMatrixFunction_set_csc, __pyx_k_pycAffineMatrixFunction_set_csc, sizeof(__pyx_k_pycAffineMatrixFunction_set_csc), 0, 0, 1, 1},
26372  {&__pyx_n_s_pycAffineMatrixFunction_set_csc_2, __pyx_k_pycAffineMatrixFunction_set_csc_2, sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_2), 0, 0, 1, 1},
26373  {&__pyx_n_s_pycAffineMatrixFunction_set_csc_3, __pyx_k_pycAffineMatrixFunction_set_csc_3, sizeof(__pyx_k_pycAffineMatrixFunction_set_csc_3), 0, 0, 1, 1},
26374  {&__pyx_n_s_pycAffineMatrixFunction_set_csr, __pyx_k_pycAffineMatrixFunction_set_csr, sizeof(__pyx_k_pycAffineMatrixFunction_set_csr), 0, 0, 1, 1},
26375  {&__pyx_n_s_pycAffineMatrixFunction_set_csr_2, __pyx_k_pycAffineMatrixFunction_set_csr_2, sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_2), 0, 0, 1, 1},
26376  {&__pyx_n_s_pycAffineMatrixFunction_set_csr_3, __pyx_k_pycAffineMatrixFunction_set_csr_3, sizeof(__pyx_k_pycAffineMatrixFunction_set_csr_3), 0, 0, 1, 1},
26377  {&__pyx_n_s_pycAffineMatrixFunction_set_dens, __pyx_k_pycAffineMatrixFunction_set_dens, sizeof(__pyx_k_pycAffineMatrixFunction_set_dens), 0, 0, 1, 1},
26378  {&__pyx_n_s_pycAffineMatrixFunction_set_dens_2, __pyx_k_pycAffineMatrixFunction_set_dens_2, sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_2), 0, 0, 1, 1},
26379  {&__pyx_n_s_pycAffineMatrixFunction_set_dens_3, __pyx_k_pycAffineMatrixFunction_set_dens_3, sizeof(__pyx_k_pycAffineMatrixFunction_set_dens_3), 0, 0, 1, 1},
26380  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26381  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26382  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
26383  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26384  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26385  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26386  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26387  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26388  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
26389  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26390  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26391  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26392  {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
26393  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
26394  {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double, sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
26395  {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float, sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
26396  {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double, sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
26397  {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double, sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
26398  {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float, sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
26399  {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double, sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
26400  {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double, sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
26401  {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float, sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
26402  {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double, sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
26403  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26404  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26405  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
26406  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
26407  {&__pyx_n_s_sort_indices, __pyx_k_sort_indices, sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
26408  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
26409  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
26410  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
26411  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26412  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26413  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26414  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26415  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
26416  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
26417  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
26418  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
26419  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26420  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
26421  {0, 0, 0, 0, 0, 0, 0}
26422 };
26423 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
26424  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 179, __pyx_L1_error)
26425  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 192, __pyx_L1_error)
26426  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
26427  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
26428  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
26429  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
26430  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
26431  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
26432  return 0;
26433  __pyx_L1_error:;
26434  return -1;
26435 }
26436 
26437 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
26438  __Pyx_RefNannyDeclarations
26439  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
26440 
26441  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":179
26442  * # Check A
26443  * if A is None:
26444  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
26445  *
26446  * if A.ndim != 2:
26447  */
26448  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 179, __pyx_L1_error)
26449  __Pyx_GOTREF(__pyx_tuple_);
26450  __Pyx_GIVEREF(__pyx_tuple_);
26451 
26452  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":182
26453  *
26454  * if A.ndim != 2:
26455  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
26456  *
26457  * # Data type
26458  */
26459  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 182, __pyx_L1_error)
26460  __Pyx_GOTREF(__pyx_tuple__2);
26461  __Pyx_GIVEREF(__pyx_tuple__2);
26462 
26463  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":192
26464  * self.data_type_name = b'float128'
26465  * else:
26466  * raise TypeError('Data type should be float32, float64, or ' + # <<<<<<<<<<<<<<
26467  * 'float128.')
26468  *
26469  */
26470  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 192, __pyx_L1_error)
26471  __Pyx_GOTREF(__pyx_tuple__3);
26472  __Pyx_GIVEREF(__pyx_tuple__3);
26473 
26474  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":208
26475  * # Check similar types of A and B
26476  * if not (type(A) == type(B)):
26477  * raise TypeError('Matrices A and B should have similar types.') # <<<<<<<<<<<<<<
26478  *
26479  * # Check A and B have the same data types
26480  */
26481  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Matrices_A_and_B_should_have_sim); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 208, __pyx_L1_error)
26482  __Pyx_GOTREF(__pyx_tuple__4);
26483  __Pyx_GIVEREF(__pyx_tuple__4);
26484 
26485  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":212
26486  * # Check A and B have the same data types
26487  * if not (A.dtype == B.dtype):
26488  * raise TypeError('A and B should have similar data types.') # <<<<<<<<<<<<<<
26489  *
26490  * # Check consistent sizes of A and B
26491  */
26492  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_similar_data); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 212, __pyx_L1_error)
26493  __Pyx_GOTREF(__pyx_tuple__5);
26494  __Pyx_GIVEREF(__pyx_tuple__5);
26495 
26496  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":216
26497  * # Check consistent sizes of A and B
26498  * if not (A.shape == B.shape):
26499  * raise ValueError('A and B should have the same shape.') # <<<<<<<<<<<<<<
26500  *
26501  * # Determine A is sparse or dense
26502  */
26503  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_A_and_B_should_have_the_same_sha); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 216, __pyx_L1_error)
26504  __Pyx_GOTREF(__pyx_tuple__6);
26505  __Pyx_GIVEREF(__pyx_tuple__6);
26506 
26507  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":327
26508  * A_is_row_major = 0
26509  * else:
26510  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
26511  *
26512  * if not B_is_identity:
26513  */
26514  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 327, __pyx_L1_error)
26515  __Pyx_GOTREF(__pyx_tuple__8);
26516  __Pyx_GIVEREF(__pyx_tuple__8);
26517 
26518  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":335
26519  * B_is_row_major = 0
26520  * else:
26521  * raise TypeError('Matrix B should be either C or F contiguous.') # <<<<<<<<<<<<<<
26522  *
26523  * # Declare memoryviews to get data pointer
26524  */
26525  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Matrix_B_should_be_either_C_or_F); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 335, __pyx_L1_error)
26526  __Pyx_GOTREF(__pyx_tuple__9);
26527  __Pyx_GIVEREF(__pyx_tuple__9);
26528 
26529  /* "(tree fragment)":2
26530  * def __reduce_cython__(self):
26531  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26532  * def __setstate_cython__(self, __pyx_state):
26533  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26534  */
26535  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
26536  __Pyx_GOTREF(__pyx_tuple__19);
26537  __Pyx_GIVEREF(__pyx_tuple__19);
26538 
26539  /* "(tree fragment)":4
26540  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26541  * def __setstate_cython__(self, __pyx_state):
26542  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26543  */
26544  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
26545  __Pyx_GOTREF(__pyx_tuple__21);
26546  __Pyx_GIVEREF(__pyx_tuple__21);
26547 
26548  /* "View.MemoryView":133
26549  *
26550  * if not self.ndim:
26551  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
26552  *
26553  * if itemsize <= 0:
26554  */
26555  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 133, __pyx_L1_error)
26556  __Pyx_GOTREF(__pyx_tuple__22);
26557  __Pyx_GIVEREF(__pyx_tuple__22);
26558 
26559  /* "View.MemoryView":136
26560  *
26561  * if itemsize <= 0:
26562  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
26563  *
26564  * if not isinstance(format, bytes):
26565  */
26566  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 136, __pyx_L1_error)
26567  __Pyx_GOTREF(__pyx_tuple__23);
26568  __Pyx_GIVEREF(__pyx_tuple__23);
26569 
26570  /* "View.MemoryView":148
26571  *
26572  * if not self._shape:
26573  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
26574  *
26575  *
26576  */
26577  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 148, __pyx_L1_error)
26578  __Pyx_GOTREF(__pyx_tuple__24);
26579  __Pyx_GIVEREF(__pyx_tuple__24);
26580 
26581  /* "View.MemoryView":176
26582  * self.data = <char *>malloc(self.len)
26583  * if not self.data:
26584  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
26585  *
26586  * if self.dtype_is_object:
26587  */
26588  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 176, __pyx_L1_error)
26589  __Pyx_GOTREF(__pyx_tuple__25);
26590  __Pyx_GIVEREF(__pyx_tuple__25);
26591 
26592  /* "View.MemoryView":192
26593  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
26594  * if not (flags & bufmode):
26595  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
26596  * info.buf = self.data
26597  * info.len = self.len
26598  */
26599  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 192, __pyx_L1_error)
26600  __Pyx_GOTREF(__pyx_tuple__26);
26601  __Pyx_GIVEREF(__pyx_tuple__26);
26602 
26603  /* "(tree fragment)":2
26604  * def __reduce_cython__(self):
26605  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26606  * def __setstate_cython__(self, __pyx_state):
26607  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26608  */
26609  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
26610  __Pyx_GOTREF(__pyx_tuple__27);
26611  __Pyx_GIVEREF(__pyx_tuple__27);
26612 
26613  /* "(tree fragment)":4
26614  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26615  * def __setstate_cython__(self, __pyx_state):
26616  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26617  */
26618  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
26619  __Pyx_GOTREF(__pyx_tuple__28);
26620  __Pyx_GIVEREF(__pyx_tuple__28);
26621 
26622  /* "View.MemoryView":418
26623  * def __setitem__(memoryview self, object index, object value):
26624  * if self.view.readonly:
26625  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
26626  *
26627  * have_slices, index = _unellipsify(index, self.view.ndim)
26628  */
26629  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 418, __pyx_L1_error)
26630  __Pyx_GOTREF(__pyx_tuple__29);
26631  __Pyx_GIVEREF(__pyx_tuple__29);
26632 
26633  /* "View.MemoryView":495
26634  * result = struct.unpack(self.view.format, bytesitem)
26635  * except struct.error:
26636  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
26637  * else:
26638  * if len(self.view.format) == 1:
26639  */
26640  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 495, __pyx_L1_error)
26641  __Pyx_GOTREF(__pyx_tuple__30);
26642  __Pyx_GIVEREF(__pyx_tuple__30);
26643 
26644  /* "View.MemoryView":520
26645  * def __getbuffer__(self, Py_buffer *info, int flags):
26646  * if flags & PyBUF_WRITABLE and self.view.readonly:
26647  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
26648  *
26649  * if flags & PyBUF_ND:
26650  */
26651  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 520, __pyx_L1_error)
26652  __Pyx_GOTREF(__pyx_tuple__31);
26653  __Pyx_GIVEREF(__pyx_tuple__31);
26654 
26655  /* "View.MemoryView":570
26656  * if self.view.strides == NULL:
26657  *
26658  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
26659  *
26660  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
26661  */
26662  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 570, __pyx_L1_error)
26663  __Pyx_GOTREF(__pyx_tuple__32);
26664  __Pyx_GIVEREF(__pyx_tuple__32);
26665 
26666  /* "View.MemoryView":577
26667  * def suboffsets(self):
26668  * if self.view.suboffsets == NULL:
26669  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
26670  *
26671  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
26672  */
26673  __pyx_tuple__33 = PyTuple_New(1); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 577, __pyx_L1_error)
26674  __Pyx_GOTREF(__pyx_tuple__33);
26675  __Pyx_INCREF(__pyx_int_neg_1);
26676  __Pyx_GIVEREF(__pyx_int_neg_1);
26677  PyTuple_SET_ITEM(__pyx_tuple__33, 0, __pyx_int_neg_1);
26678  __Pyx_GIVEREF(__pyx_tuple__33);
26679 
26680  /* "(tree fragment)":2
26681  * def __reduce_cython__(self):
26682  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26683  * def __setstate_cython__(self, __pyx_state):
26684  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26685  */
26686  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
26687  __Pyx_GOTREF(__pyx_tuple__34);
26688  __Pyx_GIVEREF(__pyx_tuple__34);
26689 
26690  /* "(tree fragment)":4
26691  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26692  * def __setstate_cython__(self, __pyx_state):
26693  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26694  */
26695  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
26696  __Pyx_GOTREF(__pyx_tuple__35);
26697  __Pyx_GIVEREF(__pyx_tuple__35);
26698 
26699  /* "View.MemoryView":682
26700  * if item is Ellipsis:
26701  * if not seen_ellipsis:
26702  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
26703  * seen_ellipsis = True
26704  * else:
26705  */
26706  __pyx_slice__36 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__36)) __PYX_ERR(1, 682, __pyx_L1_error)
26707  __Pyx_GOTREF(__pyx_slice__36);
26708  __Pyx_GIVEREF(__pyx_slice__36);
26709 
26710  /* "View.MemoryView":703
26711  * for suboffset in suboffsets[:ndim]:
26712  * if suboffset >= 0:
26713  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
26714  *
26715  *
26716  */
26717  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 703, __pyx_L1_error)
26718  __Pyx_GOTREF(__pyx_tuple__37);
26719  __Pyx_GIVEREF(__pyx_tuple__37);
26720 
26721  /* "(tree fragment)":2
26722  * def __reduce_cython__(self):
26723  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26724  * def __setstate_cython__(self, __pyx_state):
26725  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26726  */
26727  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 2, __pyx_L1_error)
26728  __Pyx_GOTREF(__pyx_tuple__38);
26729  __Pyx_GIVEREF(__pyx_tuple__38);
26730 
26731  /* "(tree fragment)":4
26732  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26733  * def __setstate_cython__(self, __pyx_state):
26734  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
26735  */
26736  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 4, __pyx_L1_error)
26737  __Pyx_GOTREF(__pyx_tuple__39);
26738  __Pyx_GIVEREF(__pyx_tuple__39);
26739 
26740  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
26741  * # ======================
26742  *
26743  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26744  * """
26745  * Sets matrix A.
26746  */
26747  __pyx_tuple__41 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 306, __pyx_L1_error)
26748  __Pyx_GOTREF(__pyx_tuple__41);
26749  __Pyx_GIVEREF(__pyx_tuple__41);
26750  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_float, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 306, __pyx_L1_error)
26751 
26752  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
26753  * # =======================
26754  *
26755  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26756  * """
26757  * Sets matrix A.
26758  */
26759  __pyx_tuple__42 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 402, __pyx_L1_error)
26760  __Pyx_GOTREF(__pyx_tuple__42);
26761  __Pyx_GIVEREF(__pyx_tuple__42);
26762  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_double, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 402, __pyx_L1_error)
26763 
26764  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
26765  * # ============================
26766  *
26767  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26768  * """
26769  * Sets matrix A.
26770  */
26771  __pyx_tuple__43 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_B_is_row_major, __pyx_n_s_A_data_mv_c, __pyx_n_s_A_data_mv_f, __pyx_n_s_B_data_mv_c, __pyx_n_s_B_data_mv_f, __pyx_n_s_A_data, __pyx_n_s_B_data); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 498, __pyx_L1_error)
26772  __Pyx_GOTREF(__pyx_tuple__43);
26773  __Pyx_GIVEREF(__pyx_tuple__43);
26774  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_dense_matrix_long_double, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 498, __pyx_L1_error)
26775 
26776  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
26777  * # ====================
26778  *
26779  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26780  * """
26781  * """
26782  */
26783  __pyx_tuple__44 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 594, __pyx_L1_error)
26784  __Pyx_GOTREF(__pyx_tuple__44);
26785  __Pyx_GIVEREF(__pyx_tuple__44);
26786  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_float, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 594, __pyx_L1_error)
26787 
26788  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
26789  * # =====================
26790  *
26791  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26792  * """
26793  * """
26794  */
26795  __pyx_tuple__45 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 665, __pyx_L1_error)
26796  __Pyx_GOTREF(__pyx_tuple__45);
26797  __Pyx_GIVEREF(__pyx_tuple__45);
26798  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_double, 665, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 665, __pyx_L1_error)
26799 
26800  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
26801  * # ==========================
26802  *
26803  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26804  * """
26805  * """
26806  */
26807  __pyx_tuple__46 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 736, __pyx_L1_error)
26808  __Pyx_GOTREF(__pyx_tuple__46);
26809  __Pyx_GIVEREF(__pyx_tuple__46);
26810  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csr_matrix_long_double, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 736, __pyx_L1_error)
26811 
26812  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
26813  * # ====================
26814  *
26815  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26816  * """
26817  * """
26818  */
26819  __pyx_tuple__47 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 807, __pyx_L1_error)
26820  __Pyx_GOTREF(__pyx_tuple__47);
26821  __Pyx_GIVEREF(__pyx_tuple__47);
26822  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_float, 807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 807, __pyx_L1_error)
26823 
26824  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
26825  * # =====================
26826  *
26827  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26828  * """
26829  * """
26830  */
26831  __pyx_tuple__48 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 878, __pyx_L1_error)
26832  __Pyx_GOTREF(__pyx_tuple__48);
26833  __Pyx_GIVEREF(__pyx_tuple__48);
26834  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_double, 878, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 878, __pyx_L1_error)
26835 
26836  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
26837  * # ==========================
26838  *
26839  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
26840  * """
26841  * """
26842  */
26843  __pyx_tuple__49 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_B_is_identity, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_mv, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_B_data_mv, __pyx_n_s_B_indices_mv, __pyx_n_s_B_index_pointer_mv, __pyx_n_s_A_data, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer, __pyx_n_s_B_data, __pyx_n_s_B_indices, __pyx_n_s_B_index_pointer); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 949, __pyx_L1_error)
26844  __Pyx_GOTREF(__pyx_tuple__49);
26845  __Pyx_GIVEREF(__pyx_tuple__49);
26846  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_af, __pyx_n_s_set_csc_matrix_long_double, 949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 949, __pyx_L1_error)
26847 
26848  /* "(tree fragment)":1
26849  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
26850  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26851  * def __setstate_cython__(self, __pyx_state):
26852  */
26853  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 1, __pyx_L1_error)
26854  __Pyx_GOTREF(__pyx_tuple__50);
26855  __Pyx_GIVEREF(__pyx_tuple__50);
26856  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 1, __pyx_L1_error)
26857 
26858  /* "(tree fragment)":3
26859  * def __reduce_cython__(self):
26860  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26861  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
26862  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26863  */
26864  __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 3, __pyx_L1_error)
26865  __Pyx_GOTREF(__pyx_tuple__51);
26866  __Pyx_GIVEREF(__pyx_tuple__51);
26867  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 3, __pyx_L1_error)
26868 
26869  /* "View.MemoryView":286
26870  * return self.name
26871  *
26872  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
26873  * cdef strided = Enum("<strided and direct>") # default
26874  * cdef indirect = Enum("<strided and indirect>")
26875  */
26876  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 286, __pyx_L1_error)
26877  __Pyx_GOTREF(__pyx_tuple__52);
26878  __Pyx_GIVEREF(__pyx_tuple__52);
26879 
26880  /* "View.MemoryView":287
26881  *
26882  * cdef generic = Enum("<strided and direct or indirect>")
26883  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
26884  * cdef indirect = Enum("<strided and indirect>")
26885  *
26886  */
26887  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
26888  __Pyx_GOTREF(__pyx_tuple__53);
26889  __Pyx_GIVEREF(__pyx_tuple__53);
26890 
26891  /* "View.MemoryView":288
26892  * cdef generic = Enum("<strided and direct or indirect>")
26893  * cdef strided = Enum("<strided and direct>") # default
26894  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
26895  *
26896  *
26897  */
26898  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 288, __pyx_L1_error)
26899  __Pyx_GOTREF(__pyx_tuple__54);
26900  __Pyx_GIVEREF(__pyx_tuple__54);
26901 
26902  /* "View.MemoryView":291
26903  *
26904  *
26905  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
26906  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
26907  *
26908  */
26909  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 291, __pyx_L1_error)
26910  __Pyx_GOTREF(__pyx_tuple__55);
26911  __Pyx_GIVEREF(__pyx_tuple__55);
26912 
26913  /* "View.MemoryView":292
26914  *
26915  * cdef contiguous = Enum("<contiguous and direct>")
26916  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
26917  *
26918  *
26919  */
26920  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 292, __pyx_L1_error)
26921  __Pyx_GOTREF(__pyx_tuple__56);
26922  __Pyx_GIVEREF(__pyx_tuple__56);
26923 
26924  /* "(tree fragment)":1
26925  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
26926  * cdef object __pyx_PickleError
26927  * cdef object __pyx_result
26928  */
26929  __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 1, __pyx_L1_error)
26930  __Pyx_GOTREF(__pyx_tuple__57);
26931  __Pyx_GIVEREF(__pyx_tuple__57);
26932  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error)
26933  __Pyx_RefNannyFinishContext();
26934  return 0;
26935  __pyx_L1_error:;
26936  __Pyx_RefNannyFinishContext();
26937  return -1;
26938 }
26939 
26940 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
26941  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
26942  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
26943  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26944  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
26945  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
26946  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26947  return 0;
26948  __pyx_L1_error:;
26949  return -1;
26950 }
26951 
26952 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
26953 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
26954 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
26955 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
26956 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
26957 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
26958 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
26959 
26960 static int __Pyx_modinit_global_init_code(void) {
26961  __Pyx_RefNannyDeclarations
26962  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
26963  /*--- Global init code ---*/
26964  generic = Py_None; Py_INCREF(Py_None);
26965  strided = Py_None; Py_INCREF(Py_None);
26966  indirect = Py_None; Py_INCREF(Py_None);
26967  contiguous = Py_None; Py_INCREF(Py_None);
26968  indirect_contiguous = Py_None; Py_INCREF(Py_None);
26969  __Pyx_RefNannyFinishContext();
26970  return 0;
26971 }
26972 
26973 static int __Pyx_modinit_variable_export_code(void) {
26974  __Pyx_RefNannyDeclarations
26975  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
26976  /*--- Variable export code ---*/
26977  __Pyx_RefNannyFinishContext();
26978  return 0;
26979 }
26980 
26981 static int __Pyx_modinit_function_export_code(void) {
26982  __Pyx_RefNannyDeclarations
26983  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
26984  /*--- Function export code ---*/
26985  __Pyx_RefNannyFinishContext();
26986  return 0;
26987 }
26988 
26989 static int __Pyx_modinit_type_init_code(void) {
26990  __Pyx_RefNannyDeclarations
26991  PyObject *__pyx_t_1 = NULL;
26992  int __pyx_lineno = 0;
26993  const char *__pyx_filename = NULL;
26994  int __pyx_clineno = 0;
26995  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
26996  /*--- Type init code ---*/
26997  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_linear_operator"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26998  __Pyx_GOTREF(__pyx_t_1);
26999  __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType(__pyx_t_1, "imate._c_linear_operator.py_c_linear_operator", "pycLinearOperator", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __Pyx_ImportType_CheckSize_Warn);
27000  if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
27001  __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
27002  __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27003  __pyx_vtable_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27004  __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
27005  if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27006  #if PY_VERSION_HEX < 0x030800B1
27007  __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_print = 0;
27008  #endif
27009  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro == PyObject_GenericGetAttr)) {
27010  __pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27011  }
27012  if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27013  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycAffineMatrixFunction, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27014  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
27015  __pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction = &__pyx_type_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction;
27016  __pyx_vtabptr_array = &__pyx_vtable_array;
27017  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
27018  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
27019  #if PY_VERSION_HEX < 0x030800B1
27020  __pyx_type___pyx_array.tp_print = 0;
27021  #endif
27022  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
27023  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
27024  __pyx_array_type = &__pyx_type___pyx_array;
27025  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
27026  #if PY_VERSION_HEX < 0x030800B1
27027  __pyx_type___pyx_MemviewEnum.tp_print = 0;
27028  #endif
27029  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
27030  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27031  }
27032  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
27033  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27034  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27035  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27036  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27037  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27038  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27039  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27040  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
27041  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27042  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
27043  #if PY_VERSION_HEX < 0x030800B1
27044  __pyx_type___pyx_memoryview.tp_print = 0;
27045  #endif
27046  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
27047  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27048  }
27049  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
27050  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
27051  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27052  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27053  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27054  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
27055  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27056  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
27057  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
27058  #if PY_VERSION_HEX < 0x030800B1
27059  __pyx_type___pyx_memoryviewslice.tp_print = 0;
27060  #endif
27061  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
27062  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27063  }
27064  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
27065  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
27066  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27067  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27068  __Pyx_RefNannyFinishContext();
27069  return 0;
27070  __pyx_L1_error:;
27071  __Pyx_XDECREF(__pyx_t_1);
27072  __Pyx_RefNannyFinishContext();
27073  return -1;
27074 }
27075 
27076 static int __Pyx_modinit_type_import_code(void) {
27077  __Pyx_RefNannyDeclarations
27078  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
27079  /*--- Type import code ---*/
27080  __Pyx_RefNannyFinishContext();
27081  return 0;
27082 }
27083 
27084 static int __Pyx_modinit_variable_import_code(void) {
27085  __Pyx_RefNannyDeclarations
27086  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
27087  /*--- Variable import code ---*/
27088  __Pyx_RefNannyFinishContext();
27089  return 0;
27090 }
27091 
27092 static int __Pyx_modinit_function_import_code(void) {
27093  __Pyx_RefNannyDeclarations
27094  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
27095  /*--- Function import code ---*/
27096  __Pyx_RefNannyFinishContext();
27097  return 0;
27098 }
27099 
27100 
27101 #ifndef CYTHON_NO_PYINIT_EXPORT
27102 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27103 #elif PY_MAJOR_VERSION < 3
27104 #ifdef __cplusplus
27105 #define __Pyx_PyMODINIT_FUNC extern "C" void
27106 #else
27107 #define __Pyx_PyMODINIT_FUNC void
27108 #endif
27109 #else
27110 #ifdef __cplusplus
27111 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27112 #else
27113 #define __Pyx_PyMODINIT_FUNC PyObject *
27114 #endif
27115 #endif
27116 
27117 
27118 #if PY_MAJOR_VERSION < 3
27119 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(void) CYTHON_SMALL_CODE; /*proto*/
27120 __Pyx_PyMODINIT_FUNC initpy_c_affine_matrix_function(void)
27121 #else
27122 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void) CYTHON_SMALL_CODE; /*proto*/
27123 __Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)
27124 #if CYTHON_PEP489_MULTI_PHASE_INIT
27125 {
27126  return PyModuleDef_Init(&__pyx_moduledef);
27127 }
27128 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
27129  #if PY_VERSION_HEX >= 0x030700A1
27130  static PY_INT64_T main_interpreter_id = -1;
27131  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27132  if (main_interpreter_id == -1) {
27133  main_interpreter_id = current_id;
27134  return (unlikely(current_id == -1)) ? -1 : 0;
27135  } else if (unlikely(main_interpreter_id != current_id))
27136  #else
27137  static PyInterpreterState *main_interpreter = NULL;
27138  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
27139  if (!main_interpreter) {
27140  main_interpreter = current_interpreter;
27141  } else if (unlikely(main_interpreter != current_interpreter))
27142  #endif
27143  {
27144  PyErr_SetString(
27145  PyExc_ImportError,
27146  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27147  return -1;
27148  }
27149  return 0;
27150 }
27151 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
27152  PyObject *value = PyObject_GetAttrString(spec, from_name);
27153  int result = 0;
27154  if (likely(value)) {
27155  if (allow_none || value != Py_None) {
27156  result = PyDict_SetItemString(moddict, to_name, value);
27157  }
27158  Py_DECREF(value);
27159  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27160  PyErr_Clear();
27161  } else {
27162  result = -1;
27163  }
27164  return result;
27165 }
27166 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
27167  PyObject *module = NULL, *moddict, *modname;
27168  if (__Pyx_check_single_interpreter())
27169  return NULL;
27170  if (__pyx_m)
27171  return __Pyx_NewRef(__pyx_m);
27172  modname = PyObject_GetAttrString(spec, "name");
27173  if (unlikely(!modname)) goto bad;
27174  module = PyModule_NewObject(modname);
27175  Py_DECREF(modname);
27176  if (unlikely(!module)) goto bad;
27177  moddict = PyModule_GetDict(module);
27178  if (unlikely(!moddict)) goto bad;
27179  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27180  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27181  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27182  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27183  return module;
27184 bad:
27185  Py_XDECREF(module);
27186  return NULL;
27187 }
27188 
27189 
27190 static CYTHON_SMALL_CODE int __pyx_pymod_exec_py_c_affine_matrix_function(PyObject *__pyx_pyinit_module)
27191 #endif
27192 #endif
27193 {
27194  __Pyx_TraceDeclarations
27195  PyObject *__pyx_t_1 = NULL;
27196  PyObject *__pyx_t_2 = NULL;
27197  static PyThread_type_lock __pyx_t_3[8];
27198  int __pyx_lineno = 0;
27199  const char *__pyx_filename = NULL;
27200  int __pyx_clineno = 0;
27201  __Pyx_RefNannyDeclarations
27202  #if CYTHON_PEP489_MULTI_PHASE_INIT
27203  if (__pyx_m) {
27204  if (__pyx_m == __pyx_pyinit_module) return 0;
27205  PyErr_SetString(PyExc_RuntimeError, "Module 'py_c_affine_matrix_function' has already been imported. Re-initialisation is not supported.");
27206  return -1;
27207  }
27208  #elif PY_MAJOR_VERSION >= 3
27209  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27210  #endif
27211  #if CYTHON_REFNANNY
27212 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27213 if (!__Pyx_RefNanny) {
27214  PyErr_Clear();
27215  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27216  if (!__Pyx_RefNanny)
27217  Py_FatalError("failed to import 'refnanny' module");
27218 }
27219 #endif
27220  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", 0);
27221  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27222  #ifdef __Pxy_PyFrame_Initialize_Offsets
27223  __Pxy_PyFrame_Initialize_Offsets();
27224  #endif
27225  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27226  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27227  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27228  #ifdef __Pyx_CyFunction_USED
27229  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27230  #endif
27231  #ifdef __Pyx_FusedFunction_USED
27232  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27233  #endif
27234  #ifdef __Pyx_Coroutine_USED
27235  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27236  #endif
27237  #ifdef __Pyx_Generator_USED
27238  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27239  #endif
27240  #ifdef __Pyx_AsyncGen_USED
27241  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27242  #endif
27243  #ifdef __Pyx_StopAsyncIteration_USED
27244  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27245  #endif
27246  /*--- Library function declarations ---*/
27247  /*--- Threads initialization code ---*/
27248  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27249  PyEval_InitThreads();
27250  #endif
27251  /*--- Module creation code ---*/
27252  #if CYTHON_PEP489_MULTI_PHASE_INIT
27253  __pyx_m = __pyx_pyinit_module;
27254  Py_INCREF(__pyx_m);
27255  #else
27256  #if PY_MAJOR_VERSION < 3
27257  __pyx_m = Py_InitModule4("py_c_affine_matrix_function", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27258  #else
27259  __pyx_m = PyModule_Create(&__pyx_moduledef);
27260  #endif
27261  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27262  #endif
27263  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27264  Py_INCREF(__pyx_d);
27265  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27266  Py_INCREF(__pyx_b);
27267  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27268  Py_INCREF(__pyx_cython_runtime);
27269  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
27270  /*--- Initialize various global constants etc. ---*/
27271  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27272  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27273  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27274  #endif
27275  if (__pyx_module_is_main_imate___c_linear_operator__py_c_affine_matrix_function) {
27276  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27277  }
27278  #if PY_MAJOR_VERSION >= 3
27279  {
27280  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27281  if (!PyDict_GetItemString(modules, "imate._c_linear_operator.py_c_affine_matrix_function")) {
27282  if (unlikely(PyDict_SetItemString(modules, "imate._c_linear_operator.py_c_affine_matrix_function", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27283  }
27284  }
27285  #endif
27286  /*--- Builtin init code ---*/
27287  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27288  /*--- Constants init code ---*/
27289  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27290  /*--- Global type/function init code ---*/
27291  (void)__Pyx_modinit_global_init_code();
27292  (void)__Pyx_modinit_variable_export_code();
27293  (void)__Pyx_modinit_function_export_code();
27294  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27295  (void)__Pyx_modinit_type_import_code();
27296  (void)__Pyx_modinit_variable_import_code();
27297  (void)__Pyx_modinit_function_import_code();
27298  /*--- Execution code ---*/
27299  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27300  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27301  #endif
27302  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_py_c_affine_matrix_function(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
27303 
27304  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":15
27305  *
27306  * # Python
27307  * import numpy # <<<<<<<<<<<<<<
27308  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix
27309  *
27310  */
27311  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
27312  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
27313  __Pyx_GOTREF(__pyx_t_1);
27314  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
27315  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27316 
27317  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":16
27318  * # Python
27319  * import numpy
27320  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix # <<<<<<<<<<<<<<
27321  *
27322  * # Cython
27323  */
27324  __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
27325  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27326  __Pyx_GOTREF(__pyx_t_1);
27327  __Pyx_INCREF(__pyx_n_s_issparse);
27328  __Pyx_GIVEREF(__pyx_n_s_issparse);
27329  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
27330  __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
27331  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
27332  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
27333  __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
27334  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
27335  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
27336  __Pyx_INCREF(__pyx_n_s_csr_matrix);
27337  __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
27338  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
27339  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
27340  __Pyx_GOTREF(__pyx_t_2);
27341  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27342  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27343  __Pyx_GOTREF(__pyx_t_1);
27344  if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27345  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27346  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27347  __Pyx_GOTREF(__pyx_t_1);
27348  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27349  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27350  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27351  __Pyx_GOTREF(__pyx_t_1);
27352  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27353  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27354  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
27355  __Pyx_GOTREF(__pyx_t_1);
27356  if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
27357  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27358  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27359 
27360  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":306
27361  * # ======================
27362  *
27363  * def set_dense_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27364  * """
27365  * Sets matrix A.
27366  */
27367  __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error))
27368  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
27369  __Pyx_GOTREF(__pyx_t_2);
27370  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
27371  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27372  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27373 
27374  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":402
27375  * # =======================
27376  *
27377  * def set_dense_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27378  * """
27379  * Sets matrix A.
27380  */
27381  __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
27382  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
27383  __Pyx_GOTREF(__pyx_t_2);
27384  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
27385  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27386  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27387 
27388  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":498
27389  * # ============================
27390  *
27391  * def set_dense_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27392  * """
27393  * Sets matrix A.
27394  */
27395  __Pyx_TraceLine(498,0,__PYX_ERR(0, 498, __pyx_L1_error))
27396  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_dens_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
27397  __Pyx_GOTREF(__pyx_t_2);
27398  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
27399  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27400  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27401 
27402  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":594
27403  * # ====================
27404  *
27405  * def set_csr_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27406  * """
27407  * """
27408  */
27409  __Pyx_TraceLine(594,0,__PYX_ERR(0, 594, __pyx_L1_error))
27410  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
27411  __Pyx_GOTREF(__pyx_t_2);
27412  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
27413  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27414  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27415 
27416  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":665
27417  * # =====================
27418  *
27419  * def set_csr_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27420  * """
27421  * """
27422  */
27423  __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error))
27424  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
27425  __Pyx_GOTREF(__pyx_t_2);
27426  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
27427  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27428  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27429 
27430  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":736
27431  * # ==========================
27432  *
27433  * def set_csr_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27434  * """
27435  * """
27436  */
27437  __Pyx_TraceLine(736,0,__PYX_ERR(0, 736, __pyx_L1_error))
27438  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csr_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
27439  __Pyx_GOTREF(__pyx_t_2);
27440  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
27441  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27442  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27443 
27444  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":807
27445  * # ====================
27446  *
27447  * def set_csc_matrix_float(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27448  * """
27449  * """
27450  */
27451  __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error))
27452  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
27453  __Pyx_GOTREF(__pyx_t_2);
27454  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 807, __pyx_L1_error)
27455  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27456  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27457 
27458  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":878
27459  * # =====================
27460  *
27461  * def set_csc_matrix_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27462  * """
27463  * """
27464  */
27465  __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L1_error))
27466  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_2, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
27467  __Pyx_GOTREF(__pyx_t_2);
27468  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 878, __pyx_L1_error)
27469  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27470  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27471 
27472  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":949
27473  * # ==========================
27474  *
27475  * def set_csc_matrix_long_double(self, A, B, B_is_identity): # <<<<<<<<<<<<<<
27476  * """
27477  * """
27478  */
27479  __Pyx_TraceLine(949,0,__PYX_ERR(0, 949, __pyx_L1_error))
27480  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction_set_csc_3, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
27481  __Pyx_GOTREF(__pyx_t_2);
27482  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
27483  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27484  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_27py_c_affine_matrix_function_pycAffineMatrixFunction);
27485 
27486  /* "(tree fragment)":1
27487  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
27488  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27489  * def __setstate_cython__(self, __pyx_state):
27490  */
27491  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
27492  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___reduce, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
27493  __Pyx_GOTREF(__pyx_t_2);
27494  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
27495  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27496 
27497  /* "(tree fragment)":3
27498  * def __reduce_cython__(self):
27499  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27500  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
27501  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27502  */
27503  __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
27504  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_27py_c_affine_matrix_function_23pycAffineMatrixFunction_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycAffineMatrixFunction___setsta, NULL, __pyx_n_s_imate__c_linear_operator_py_c_af_2, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
27505  __Pyx_GOTREF(__pyx_t_2);
27506  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
27507  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27508 
27509  /* "imate/_c_linear_operator/py_c_affine_matrix_function.pyx":1
27510  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
27511  * # SPDX-License-Identifier: BSD-3-Clause
27512  * # SPDX-FileType: SOURCE
27513  */
27514  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
27515  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27516  __Pyx_GOTREF(__pyx_t_2);
27517  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27518  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27519 
27520  /* "View.MemoryView":209
27521  * info.obj = self
27522  *
27523  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
27524  *
27525  * def __dealloc__(array self):
27526  */
27527  __Pyx_TraceLine(209,0,__PYX_ERR(1, 209, __pyx_L1_error))
27528  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
27529  __Pyx_GOTREF(__pyx_t_2);
27530  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
27531  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27532  PyType_Modified(__pyx_array_type);
27533 
27534  /* "View.MemoryView":226
27535  *
27536  * @cname('get_memview')
27537  * cdef get_memview(self): # <<<<<<<<<<<<<<
27538  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
27539  * return memoryview(self, flags, self.dtype_is_object)
27540  */
27541  __Pyx_TraceLine(226,0,__PYX_ERR(1, 226, __pyx_L1_error))
27542 
27543 
27544  /* "View.MemoryView":244
27545  *
27546  * @cname("__pyx_array_new")
27547  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
27548  * char *mode, char *buf):
27549  * cdef array result
27550  */
27551  __Pyx_TraceLine(244,0,__PYX_ERR(1, 244, __pyx_L1_error))
27552 
27553 
27554  /* "View.MemoryView":286
27555  * return self.name
27556  *
27557  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27558  * cdef strided = Enum("<strided and direct>") # default
27559  * cdef indirect = Enum("<strided and indirect>")
27560  */
27561  __Pyx_TraceLine(286,0,__PYX_ERR(1, 286, __pyx_L1_error))
27562  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error)
27563  __Pyx_GOTREF(__pyx_t_2);
27564  __Pyx_XGOTREF(generic);
27565  __Pyx_DECREF_SET(generic, __pyx_t_2);
27566  __Pyx_GIVEREF(__pyx_t_2);
27567  __pyx_t_2 = 0;
27568 
27569  /* "View.MemoryView":287
27570  *
27571  * cdef generic = Enum("<strided and direct or indirect>")
27572  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27573  * cdef indirect = Enum("<strided and indirect>")
27574  *
27575  */
27576  __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
27577  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
27578  __Pyx_GOTREF(__pyx_t_2);
27579  __Pyx_XGOTREF(strided);
27580  __Pyx_DECREF_SET(strided, __pyx_t_2);
27581  __Pyx_GIVEREF(__pyx_t_2);
27582  __pyx_t_2 = 0;
27583 
27584  /* "View.MemoryView":288
27585  * cdef generic = Enum("<strided and direct or indirect>")
27586  * cdef strided = Enum("<strided and direct>") # default
27587  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27588  *
27589  *
27590  */
27591  __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
27592  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
27593  __Pyx_GOTREF(__pyx_t_2);
27594  __Pyx_XGOTREF(indirect);
27595  __Pyx_DECREF_SET(indirect, __pyx_t_2);
27596  __Pyx_GIVEREF(__pyx_t_2);
27597  __pyx_t_2 = 0;
27598 
27599  /* "View.MemoryView":291
27600  *
27601  *
27602  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27603  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27604  *
27605  */
27606  __Pyx_TraceLine(291,0,__PYX_ERR(1, 291, __pyx_L1_error))
27607  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
27608  __Pyx_GOTREF(__pyx_t_2);
27609  __Pyx_XGOTREF(contiguous);
27610  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
27611  __Pyx_GIVEREF(__pyx_t_2);
27612  __pyx_t_2 = 0;
27613 
27614  /* "View.MemoryView":292
27615  *
27616  * cdef contiguous = Enum("<contiguous and direct>")
27617  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27618  *
27619  *
27620  */
27621  __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
27622  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
27623  __Pyx_GOTREF(__pyx_t_2);
27624  __Pyx_XGOTREF(indirect_contiguous);
27625  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
27626  __Pyx_GIVEREF(__pyx_t_2);
27627  __pyx_t_2 = 0;
27628 
27629  /* "View.MemoryView":298
27630  *
27631  * @cname('__pyx_align_pointer')
27632  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
27633  * "Align pointer memory on a given boundary"
27634  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
27635  */
27636  __Pyx_TraceLine(298,0,__PYX_ERR(1, 298, __pyx_L1_error))
27637 
27638 
27639  /* "View.MemoryView":316
27640  *
27641  * DEF THREAD_LOCKS_PREALLOCATED = 8
27642  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
27643  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
27644  * PyThread_allocate_lock(),
27645  */
27646  __Pyx_TraceLine(316,0,__PYX_ERR(1, 316, __pyx_L1_error))
27647  __pyx_memoryview_thread_locks_used = 0;
27648 
27649  /* "View.MemoryView":317
27650  * DEF THREAD_LOCKS_PREALLOCATED = 8
27651  * cdef int __pyx_memoryview_thread_locks_used = 0
27652  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
27653  * PyThread_allocate_lock(),
27654  * PyThread_allocate_lock(),
27655  */
27656  __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
27657  __pyx_t_3[0] = PyThread_allocate_lock();
27658  __pyx_t_3[1] = PyThread_allocate_lock();
27659  __pyx_t_3[2] = PyThread_allocate_lock();
27660  __pyx_t_3[3] = PyThread_allocate_lock();
27661  __pyx_t_3[4] = PyThread_allocate_lock();
27662  __pyx_t_3[5] = PyThread_allocate_lock();
27663  __pyx_t_3[6] = PyThread_allocate_lock();
27664  __pyx_t_3[7] = PyThread_allocate_lock();
27665  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27666 
27667  /* "View.MemoryView":393
27668  * PyThread_free_lock(self.lock)
27669  *
27670  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
27671  * cdef Py_ssize_t dim
27672  * cdef char *itemp = <char *> self.view.buf
27673  */
27674  __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
27675 
27676 
27677  /* "View.MemoryView":431
27678  * self.setitem_indexed(index, value)
27679  *
27680  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
27681  * if not isinstance(obj, memoryview):
27682  * try:
27683  */
27684  __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
27685 
27686 
27687  /* "View.MemoryView":441
27688  * return obj
27689  *
27690  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
27691  * cdef __Pyx_memviewslice dst_slice
27692  * cdef __Pyx_memviewslice src_slice
27693  */
27694  __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
27695 
27696 
27697  /* "View.MemoryView":449
27698  * src.ndim, dst.ndim, self.dtype_is_object)
27699  *
27700  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
27701  * cdef int array[128]
27702  * cdef void *tmp = NULL
27703  */
27704  __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
27705 
27706 
27707  /* "View.MemoryView":481
27708  * PyMem_Free(tmp)
27709  *
27710  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
27711  * cdef char *itemp = self.get_item_pointer(index)
27712  * self.assign_item_from_object(itemp, value)
27713  */
27714  __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L1_error))
27715 
27716 
27717  /* "View.MemoryView":485
27718  * self.assign_item_from_object(itemp, value)
27719  *
27720  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
27721  * """Only used if instantiated manually by the user, or if Cython doesn't
27722  * know how to convert the type"""
27723  */
27724  __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
27725 
27726 
27727  /* "View.MemoryView":501
27728  * return result
27729  *
27730  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
27731  * """Only used if instantiated manually by the user, or if Cython doesn't
27732  * know how to convert the type"""
27733  */
27734  __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L1_error))
27735 
27736 
27737  /* "View.MemoryView":549
27738  * info.obj = self
27739  *
27740  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
27741  *
27742  *
27743  */
27744  __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
27745  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error)
27746  __Pyx_GOTREF(__pyx_t_2);
27747  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
27748  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27749  PyType_Modified(__pyx_memoryview_type);
27750 
27751  /* "View.MemoryView":657
27752  *
27753  * @cname('__pyx_memoryview_new')
27754  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
27755  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
27756  * result.typeinfo = typeinfo
27757  */
27758  __Pyx_TraceLine(657,0,__PYX_ERR(1, 657, __pyx_L1_error))
27759 
27760 
27761  /* "View.MemoryView":663
27762  *
27763  * @cname('__pyx_memoryview_check')
27764  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
27765  * return isinstance(o, memoryview)
27766  *
27767  */
27768  __Pyx_TraceLine(663,0,__PYX_ERR(1, 663, __pyx_L1_error))
27769 
27770 
27771  /* "View.MemoryView":666
27772  * return isinstance(o, memoryview)
27773  *
27774  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
27775  * """
27776  * Replace all ellipses with full slices and fill incomplete indices with
27777  */
27778  __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
27779 
27780 
27781  /* "View.MemoryView":700
27782  * return have_slices or nslices, tuple(result)
27783  *
27784  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
27785  * for suboffset in suboffsets[:ndim]:
27786  * if suboffset >= 0:
27787  */
27788  __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
27789 
27790 
27791  /* "View.MemoryView":710
27792  *
27793  * @cname('__pyx_memview_slice')
27794  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
27795  * cdef int new_ndim = 0, suboffset_dim = -1, dim
27796  * cdef bint negative_step
27797  */
27798  __Pyx_TraceLine(710,0,__PYX_ERR(1, 710, __pyx_L1_error))
27799 
27800 
27801  /* "View.MemoryView":807
27802  *
27803  * @cname('__pyx_memoryview_slice_memviewslice')
27804  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
27805  * __Pyx_memviewslice *dst,
27806  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
27807  */
27808  __Pyx_TraceLine(807,0,__PYX_ERR(1, 807, __pyx_L1_error))
27809 
27810 
27811  /* "View.MemoryView":910
27812  *
27813  * @cname('__pyx_pybuffer_index')
27814  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
27815  * Py_ssize_t dim) except NULL:
27816  * cdef Py_ssize_t shape, stride, suboffset = -1
27817  */
27818  __Pyx_TraceLine(910,0,__PYX_ERR(1, 910, __pyx_L1_error))
27819 
27820 
27821  /* "View.MemoryView":943
27822  *
27823  * @cname('__pyx_memslice_transpose')
27824  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
27825  * cdef int ndim = memslice.memview.view.ndim
27826  *
27827  */
27828  __Pyx_TraceLine(943,0,__PYX_ERR(1, 943, __pyx_L1_error))
27829 
27830 
27831  /* "View.MemoryView":979
27832  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
27833  *
27834  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
27835  * if self.to_object_func != NULL:
27836  * return self.to_object_func(itemp)
27837  */
27838  __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
27839 
27840 
27841  /* "View.MemoryView":985
27842  * return memoryview.convert_item_to_object(self, itemp)
27843  *
27844  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
27845  * if self.to_dtype_func != NULL:
27846  * self.to_dtype_func(itemp, value)
27847  */
27848  __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
27849 
27850 
27851  /* "View.MemoryView":995
27852  * return self.from_object
27853  *
27854  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
27855  *
27856  *
27857  */
27858  __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
27859  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error)
27860  __Pyx_GOTREF(__pyx_t_2);
27861  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
27862  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27863  PyType_Modified(__pyx_memoryviewslice_type);
27864 
27865  /* "View.MemoryView":999
27866  *
27867  * @cname('__pyx_memoryview_fromslice')
27868  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
27869  * int ndim,
27870  * object (*to_object_func)(char *),
27871  */
27872  __Pyx_TraceLine(999,0,__PYX_ERR(1, 999, __pyx_L1_error))
27873 
27874 
27875  /* "View.MemoryView":1052
27876  *
27877  * @cname('__pyx_memoryview_get_slice_from_memoryview')
27878  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
27879  * __Pyx_memviewslice *mslice) except NULL:
27880  * cdef _memoryviewslice obj
27881  */
27882  __Pyx_TraceLine(1052,0,__PYX_ERR(1, 1052, __pyx_L1_error))
27883 
27884 
27885  /* "View.MemoryView":1063
27886  *
27887  * @cname('__pyx_memoryview_slice_copy')
27888  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
27889  * cdef int dim
27890  * cdef (Py_ssize_t*) shape, strides, suboffsets
27891  */
27892  __Pyx_TraceLine(1063,0,__PYX_ERR(1, 1063, __pyx_L1_error))
27893 
27894 
27895  /* "View.MemoryView":1080
27896  *
27897  * @cname('__pyx_memoryview_copy_object')
27898  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
27899  * "Create a new memoryview object"
27900  * cdef __Pyx_memviewslice memviewslice
27901  */
27902  __Pyx_TraceLine(1080,0,__PYX_ERR(1, 1080, __pyx_L1_error))
27903 
27904 
27905  /* "View.MemoryView":1087
27906  *
27907  * @cname('__pyx_memoryview_copy_object_from_slice')
27908  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
27909  * """
27910  * Create a new memoryview object from a given memoryview object and slice.
27911  */
27912  __Pyx_TraceLine(1087,0,__PYX_ERR(1, 1087, __pyx_L1_error))
27913 
27914 
27915  /* "View.MemoryView":1109
27916  *
27917  *
27918  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
27919  * if arg < 0:
27920  * return -arg
27921  */
27922  __Pyx_TraceLine(1109,0,__PYX_ERR(1, 1109, __pyx_L1_error))
27923 
27924 
27925  /* "View.MemoryView":1116
27926  *
27927  * @cname('__pyx_get_best_slice_order')
27928  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
27929  * """
27930  * Figure out the best memory access order for a given slice.
27931  */
27932  __Pyx_TraceLine(1116,0,__PYX_ERR(1, 1116, __pyx_L1_error))
27933 
27934 
27935  /* "View.MemoryView":1170
27936  * dst_data += dst_stride
27937  *
27938  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
27939  * __Pyx_memviewslice *dst,
27940  * int ndim, size_t itemsize) nogil:
27941  */
27942  __Pyx_TraceLine(1170,0,__PYX_ERR(1, 1170, __pyx_L1_error))
27943 
27944 
27945  /* "View.MemoryView":1177
27946  *
27947  * @cname('__pyx_memoryview_slice_get_size')
27948  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
27949  * "Return the size of the memory occupied by the slice in number of bytes"
27950  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
27951  */
27952  __Pyx_TraceLine(1177,0,__PYX_ERR(1, 1177, __pyx_L1_error))
27953 
27954 
27955  /* "View.MemoryView":1187
27956  *
27957  * @cname('__pyx_fill_contig_strides_array')
27958  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
27959  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
27960  * int ndim, char order) nogil:
27961  */
27962  __Pyx_TraceLine(1187,0,__PYX_ERR(1, 1187, __pyx_L1_error))
27963 
27964 
27965  /* "View.MemoryView":1208
27966  *
27967  * @cname('__pyx_memoryview_copy_data_to_temp')
27968  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
27969  * __Pyx_memviewslice *tmpslice,
27970  * char order,
27971  */
27972  __Pyx_TraceLine(1208,0,__PYX_ERR(1, 1208, __pyx_L1_error))
27973 
27974 
27975  /* "View.MemoryView":1251
27976  *
27977  * @cname('__pyx_memoryview_err_extents')
27978  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
27979  * Py_ssize_t extent2) except -1 with gil:
27980  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
27981  */
27982  __Pyx_TraceLine(1251,0,__PYX_ERR(1, 1251, __pyx_L1_error))
27983 
27984 
27985  /* "View.MemoryView":1257
27986  *
27987  * @cname('__pyx_memoryview_err_dim')
27988  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
27989  * raise error(msg.decode('ascii') % dim)
27990  *
27991  */
27992  __Pyx_TraceLine(1257,0,__PYX_ERR(1, 1257, __pyx_L1_error))
27993 
27994 
27995  /* "View.MemoryView":1261
27996  *
27997  * @cname('__pyx_memoryview_err')
27998  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
27999  * if msg != NULL:
28000  * raise error(msg.decode('ascii'))
28001  */
28002  __Pyx_TraceLine(1261,0,__PYX_ERR(1, 1261, __pyx_L1_error))
28003 
28004 
28005  /* "View.MemoryView":1268
28006  *
28007  * @cname('__pyx_memoryview_copy_contents')
28008  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
28009  * __Pyx_memviewslice dst,
28010  * int src_ndim, int dst_ndim,
28011  */
28012  __Pyx_TraceLine(1268,0,__PYX_ERR(1, 1268, __pyx_L1_error))
28013 
28014 
28015  /* "View.MemoryView":1340
28016  *
28017  * @cname('__pyx_memoryview_broadcast_leading')
28018  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
28019  * int ndim,
28020  * int ndim_other) nogil:
28021  */
28022  __Pyx_TraceLine(1340,0,__PYX_ERR(1, 1340, __pyx_L1_error))
28023 
28024 
28025  /* "View.MemoryView":1362
28026  *
28027  * @cname('__pyx_memoryview_refcount_copying')
28028  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
28029  * int ndim, bint inc) nogil:
28030  *
28031  */
28032  __Pyx_TraceLine(1362,0,__PYX_ERR(1, 1362, __pyx_L1_error))
28033 
28034 
28035  /* "View.MemoryView":1371
28036  *
28037  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
28038  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
28039  * Py_ssize_t *strides, int ndim,
28040  * bint inc) with gil:
28041  */
28042  __Pyx_TraceLine(1371,0,__PYX_ERR(1, 1371, __pyx_L1_error))
28043 
28044 
28045  /* "View.MemoryView":1377
28046  *
28047  * @cname('__pyx_memoryview_refcount_objects_in_slice')
28048  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
28049  * Py_ssize_t *strides, int ndim, bint inc):
28050  * cdef Py_ssize_t i
28051  */
28052  __Pyx_TraceLine(1377,0,__PYX_ERR(1, 1377, __pyx_L1_error))
28053 
28054 
28055  /* "View.MemoryView":1397
28056  *
28057  * @cname('__pyx_memoryview_slice_assign_scalar')
28058  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
28059  * size_t itemsize, void *item,
28060  * bint dtype_is_object) nogil:
28061  */
28062  __Pyx_TraceLine(1397,0,__PYX_ERR(1, 1397, __pyx_L1_error))
28063 
28064 
28065  /* "View.MemoryView":1407
28066  *
28067  * @cname('__pyx_memoryview__slice_assign_scalar')
28068  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
28069  * Py_ssize_t *strides, int ndim,
28070  * size_t itemsize, void *item) nogil:
28071  */
28072  __Pyx_TraceLine(1407,0,__PYX_ERR(1, 1407, __pyx_L1_error))
28073 
28074 
28075  /* "(tree fragment)":1
28076  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
28077  * cdef object __pyx_PickleError
28078  * cdef object __pyx_result
28079  */
28080  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
28081  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
28082  __Pyx_GOTREF(__pyx_t_2);
28083  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
28084  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28085 
28086  /* "(tree fragment)":11
28087  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
28088  * return __pyx_result
28089  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
28090  * __pyx_result.name = __pyx_state[0]
28091  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
28092  */
28093  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
28094 
28095  __Pyx_TraceReturn(Py_None, 0);
28096 
28097  /*--- Wrapped vars code ---*/
28098 
28099  goto __pyx_L0;
28100  __pyx_L1_error:;
28101  __Pyx_XDECREF(__pyx_t_1);
28102  __Pyx_XDECREF(__pyx_t_2);
28103  if (__pyx_m) {
28104  if (__pyx_d) {
28105  __Pyx_AddTraceback("init imate._c_linear_operator.py_c_affine_matrix_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
28106  }
28107  Py_CLEAR(__pyx_m);
28108  } else if (!PyErr_Occurred()) {
28109  PyErr_SetString(PyExc_ImportError, "init imate._c_linear_operator.py_c_affine_matrix_function");
28110  }
28111  __pyx_L0:;
28112  __Pyx_RefNannyFinishContext();
28113  #if CYTHON_PEP489_MULTI_PHASE_INIT
28114  return (__pyx_m != NULL) ? 0 : -1;
28115  #elif PY_MAJOR_VERSION >= 3
28116  return __pyx_m;
28117  #else
28118  return;
28119  #endif
28120 }
28121 
28122 /* --- Runtime support code --- */
28123 /* Refnanny */
28124 #if CYTHON_REFNANNY
28125 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
28126  PyObject *m = NULL, *p = NULL;
28127  void *r = NULL;
28128  m = PyImport_ImportModule(modname);
28129  if (!m) goto end;
28130  p = PyObject_GetAttrString(m, "RefNannyAPI");
28131  if (!p) goto end;
28132  r = PyLong_AsVoidPtr(p);
28133 end:
28134  Py_XDECREF(p);
28135  Py_XDECREF(m);
28136  return (__Pyx_RefNannyAPIStruct *)r;
28137 }
28138 #endif
28139 
28140 /* PyObjectGetAttrStr */
28141 #if CYTHON_USE_TYPE_SLOTS
28142 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28143  PyTypeObject* tp = Py_TYPE(obj);
28144  if (likely(tp->tp_getattro))
28145  return tp->tp_getattro(obj, attr_name);
28146 #if PY_MAJOR_VERSION < 3
28147  if (likely(tp->tp_getattr))
28148  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28149 #endif
28150  return PyObject_GetAttr(obj, attr_name);
28151 }
28152 #endif
28153 
28154 /* GetBuiltinName */
28155 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28156  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
28157  if (unlikely(!result)) {
28158  PyErr_Format(PyExc_NameError,
28159 #if PY_MAJOR_VERSION >= 3
28160  "name '%U' is not defined", name);
28161 #else
28162  "name '%.200s' is not defined", PyString_AS_STRING(name));
28163 #endif
28164  }
28165  return result;
28166 }
28167 
28168 /* RaiseDoubleKeywords */
28169 static void __Pyx_RaiseDoubleKeywordsError(
28170  const char* func_name,
28171  PyObject* kw_name)
28172 {
28173  PyErr_Format(PyExc_TypeError,
28174  #if PY_MAJOR_VERSION >= 3
28175  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28176  #else
28177  "%s() got multiple values for keyword argument '%s'", func_name,
28178  PyString_AsString(kw_name));
28179  #endif
28180 }
28181 
28182 /* ParseKeywords */
28183 static int __Pyx_ParseOptionalKeywords(
28184  PyObject *kwds,
28185  PyObject **argnames[],
28186  PyObject *kwds2,
28187  PyObject *values[],
28188  Py_ssize_t num_pos_args,
28189  const char* function_name)
28190 {
28191  PyObject *key = 0, *value = 0;
28192  Py_ssize_t pos = 0;
28193  PyObject*** name;
28194  PyObject*** first_kw_arg = argnames + num_pos_args;
28195  while (PyDict_Next(kwds, &pos, &key, &value)) {
28196  name = first_kw_arg;
28197  while (*name && (**name != key)) name++;
28198  if (*name) {
28199  values[name-argnames] = value;
28200  continue;
28201  }
28202  name = first_kw_arg;
28203  #if PY_MAJOR_VERSION < 3
28204  if (likely(PyString_Check(key))) {
28205  while (*name) {
28206  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28207  && _PyString_Eq(**name, key)) {
28208  values[name-argnames] = value;
28209  break;
28210  }
28211  name++;
28212  }
28213  if (*name) continue;
28214  else {
28215  PyObject*** argname = argnames;
28216  while (argname != first_kw_arg) {
28217  if ((**argname == key) || (
28218  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28219  && _PyString_Eq(**argname, key))) {
28220  goto arg_passed_twice;
28221  }
28222  argname++;
28223  }
28224  }
28225  } else
28226  #endif
28227  if (likely(PyUnicode_Check(key))) {
28228  while (*name) {
28229  int cmp = (**name == key) ? 0 :
28230  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28231  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28232  #endif
28233  PyUnicode_Compare(**name, key);
28234  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28235  if (cmp == 0) {
28236  values[name-argnames] = value;
28237  break;
28238  }
28239  name++;
28240  }
28241  if (*name) continue;
28242  else {
28243  PyObject*** argname = argnames;
28244  while (argname != first_kw_arg) {
28245  int cmp = (**argname == key) ? 0 :
28246  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28247  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28248  #endif
28249  PyUnicode_Compare(**argname, key);
28250  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28251  if (cmp == 0) goto arg_passed_twice;
28252  argname++;
28253  }
28254  }
28255  } else
28256  goto invalid_keyword_type;
28257  if (kwds2) {
28258  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
28259  } else {
28260  goto invalid_keyword;
28261  }
28262  }
28263  return 0;
28264 arg_passed_twice:
28265  __Pyx_RaiseDoubleKeywordsError(function_name, key);
28266  goto bad;
28267 invalid_keyword_type:
28268  PyErr_Format(PyExc_TypeError,
28269  "%.200s() keywords must be strings", function_name);
28270  goto bad;
28271 invalid_keyword:
28272  PyErr_Format(PyExc_TypeError,
28273  #if PY_MAJOR_VERSION < 3
28274  "%.200s() got an unexpected keyword argument '%.200s'",
28275  function_name, PyString_AsString(key));
28276  #else
28277  "%s() got an unexpected keyword argument '%U'",
28278  function_name, key);
28279  #endif
28280 bad:
28281  return -1;
28282 }
28283 
28284 /* RaiseArgTupleInvalid */
28285 static void __Pyx_RaiseArgtupleInvalid(
28286  const char* func_name,
28287  int exact,
28288  Py_ssize_t num_min,
28289  Py_ssize_t num_max,
28290  Py_ssize_t num_found)
28291 {
28292  Py_ssize_t num_expected;
28293  const char *more_or_less;
28294  if (num_found < num_min) {
28295  num_expected = num_min;
28296  more_or_less = "at least";
28297  } else {
28298  num_expected = num_max;
28299  more_or_less = "at most";
28300  }
28301  if (exact) {
28302  more_or_less = "exactly";
28303  }
28304  PyErr_Format(PyExc_TypeError,
28305  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
28306  func_name, more_or_less, num_expected,
28307  (num_expected == 1) ? "" : "s", num_found);
28308 }
28309 
28310 /* PyErrFetchRestore */
28311 #if CYTHON_FAST_THREAD_STATE
28312 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28313  PyObject *tmp_type, *tmp_value, *tmp_tb;
28314  tmp_type = tstate->curexc_type;
28315  tmp_value = tstate->curexc_value;
28316  tmp_tb = tstate->curexc_traceback;
28317  tstate->curexc_type = type;
28318  tstate->curexc_value = value;
28319  tstate->curexc_traceback = tb;
28320  Py_XDECREF(tmp_type);
28321  Py_XDECREF(tmp_value);
28322  Py_XDECREF(tmp_tb);
28323 }
28324 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28325  *type = tstate->curexc_type;
28326  *value = tstate->curexc_value;
28327  *tb = tstate->curexc_traceback;
28328  tstate->curexc_type = 0;
28329  tstate->curexc_value = 0;
28330  tstate->curexc_traceback = 0;
28331 }
28332 #endif
28333 
28334 /* Profile */
28335 #if CYTHON_PROFILE
28336 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
28337  PyFrameObject** frame,
28338  PyThreadState* tstate,
28339  const char *funcname,
28340  const char *srcfile,
28341  int firstlineno) {
28342  PyObject *type, *value, *traceback;
28343  int retval;
28344  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
28345  if (*code == NULL) {
28346  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
28347  if (*code == NULL) return 0;
28348  }
28349  *frame = PyFrame_New(
28350  tstate, /*PyThreadState *tstate*/
28351  *code, /*PyCodeObject *code*/
28352  __pyx_d, /*PyObject *globals*/
28353  0 /*PyObject *locals*/
28354  );
28355  if (*frame == NULL) return 0;
28356  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
28357  Py_INCREF(Py_None);
28358  (*frame)->f_trace = Py_None;
28359  }
28360 #if PY_VERSION_HEX < 0x030400B1
28361  } else {
28362  (*frame)->f_tstate = tstate;
28363 #endif
28364  }
28365  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
28366  retval = 1;
28367  tstate->tracing++;
28368  __Pyx_SetTracing(tstate, 0);
28369  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
28370  #if CYTHON_TRACE
28371  if (tstate->c_tracefunc)
28372  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
28373  if (retval && tstate->c_profilefunc)
28374  #endif
28375  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
28376  __Pyx_SetTracing(tstate, (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)));
28377  tstate->tracing--;
28378  if (retval) {
28379  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
28380  return __Pyx_IsTracing(tstate, 0, 0) && retval;
28381  } else {
28382  Py_XDECREF(type);
28383  Py_XDECREF(value);
28384  Py_XDECREF(traceback);
28385  return -1;
28386  }
28387 }
28388 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
28389  PyCodeObject *py_code = 0;
28390 #if PY_MAJOR_VERSION >= 3
28391  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
28392  if (likely(py_code)) {
28393  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
28394  }
28395 #else
28396  PyObject *py_srcfile = 0;
28397  PyObject *py_funcname = 0;
28398  py_funcname = PyString_FromString(funcname);
28399  if (unlikely(!py_funcname)) goto bad;
28400  py_srcfile = PyString_FromString(srcfile);
28401  if (unlikely(!py_srcfile)) goto bad;
28402  py_code = PyCode_New(
28403  0,
28404  0,
28405  0,
28406  CO_OPTIMIZED | CO_NEWLOCALS,
28407  __pyx_empty_bytes, /*PyObject *code,*/
28408  __pyx_empty_tuple, /*PyObject *consts,*/
28409  __pyx_empty_tuple, /*PyObject *names,*/
28410  __pyx_empty_tuple, /*PyObject *varnames,*/
28411  __pyx_empty_tuple, /*PyObject *freevars,*/
28412  __pyx_empty_tuple, /*PyObject *cellvars,*/
28413  py_srcfile, /*PyObject *filename,*/
28414  py_funcname, /*PyObject *name,*/
28415  firstlineno,
28416  __pyx_empty_bytes /*PyObject *lnotab*/
28417  );
28418 bad:
28419  Py_XDECREF(py_srcfile);
28420  Py_XDECREF(py_funcname);
28421 #endif
28422  return py_code;
28423 }
28424 #endif
28425 
28426 /* PyObjectCall */
28427 #if CYTHON_COMPILING_IN_CPYTHON
28428 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28429  PyObject *result;
28430  ternaryfunc call = Py_TYPE(func)->tp_call;
28431  if (unlikely(!call))
28432  return PyObject_Call(func, arg, kw);
28433  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28434  return NULL;
28435  result = (*call)(func, arg, kw);
28436  Py_LeaveRecursiveCall();
28437  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28438  PyErr_SetString(
28439  PyExc_SystemError,
28440  "NULL result without error in PyObject_Call");
28441  }
28442  return result;
28443 }
28444 #endif
28445 
28446 /* RaiseException */
28447 #if PY_MAJOR_VERSION < 3
28448 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
28449  CYTHON_UNUSED PyObject *cause) {
28450  __Pyx_PyThreadState_declare
28451  Py_XINCREF(type);
28452  if (!value || value == Py_None)
28453  value = NULL;
28454  else
28455  Py_INCREF(value);
28456  if (!tb || tb == Py_None)
28457  tb = NULL;
28458  else {
28459  Py_INCREF(tb);
28460  if (!PyTraceBack_Check(tb)) {
28461  PyErr_SetString(PyExc_TypeError,
28462  "raise: arg 3 must be a traceback or None");
28463  goto raise_error;
28464  }
28465  }
28466  if (PyType_Check(type)) {
28467 #if CYTHON_COMPILING_IN_PYPY
28468  if (!value) {
28469  Py_INCREF(Py_None);
28470  value = Py_None;
28471  }
28472 #endif
28473  PyErr_NormalizeException(&type, &value, &tb);
28474  } else {
28475  if (value) {
28476  PyErr_SetString(PyExc_TypeError,
28477  "instance exception may not have a separate value");
28478  goto raise_error;
28479  }
28480  value = type;
28481  type = (PyObject*) Py_TYPE(type);
28482  Py_INCREF(type);
28483  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
28484  PyErr_SetString(PyExc_TypeError,
28485  "raise: exception class must be a subclass of BaseException");
28486  goto raise_error;
28487  }
28488  }
28489  __Pyx_PyThreadState_assign
28490  __Pyx_ErrRestore(type, value, tb);
28491  return;
28492 raise_error:
28493  Py_XDECREF(value);
28494  Py_XDECREF(type);
28495  Py_XDECREF(tb);
28496  return;
28497 }
28498 #else
28499 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28500  PyObject* owned_instance = NULL;
28501  if (tb == Py_None) {
28502  tb = 0;
28503  } else if (tb && !PyTraceBack_Check(tb)) {
28504  PyErr_SetString(PyExc_TypeError,
28505  "raise: arg 3 must be a traceback or None");
28506  goto bad;
28507  }
28508  if (value == Py_None)
28509  value = 0;
28510  if (PyExceptionInstance_Check(type)) {
28511  if (value) {
28512  PyErr_SetString(PyExc_TypeError,
28513  "instance exception may not have a separate value");
28514  goto bad;
28515  }
28516  value = type;
28517  type = (PyObject*) Py_TYPE(value);
28518  } else if (PyExceptionClass_Check(type)) {
28519  PyObject *instance_class = NULL;
28520  if (value && PyExceptionInstance_Check(value)) {
28521  instance_class = (PyObject*) Py_TYPE(value);
28522  if (instance_class != type) {
28523  int is_subclass = PyObject_IsSubclass(instance_class, type);
28524  if (!is_subclass) {
28525  instance_class = NULL;
28526  } else if (unlikely(is_subclass == -1)) {
28527  goto bad;
28528  } else {
28529  type = instance_class;
28530  }
28531  }
28532  }
28533  if (!instance_class) {
28534  PyObject *args;
28535  if (!value)
28536  args = PyTuple_New(0);
28537  else if (PyTuple_Check(value)) {
28538  Py_INCREF(value);
28539  args = value;
28540  } else
28541  args = PyTuple_Pack(1, value);
28542  if (!args)
28543  goto bad;
28544  owned_instance = PyObject_Call(type, args, NULL);
28545  Py_DECREF(args);
28546  if (!owned_instance)
28547  goto bad;
28548  value = owned_instance;
28549  if (!PyExceptionInstance_Check(value)) {
28550  PyErr_Format(PyExc_TypeError,
28551  "calling %R should have returned an instance of "
28552  "BaseException, not %R",
28553  type, Py_TYPE(value));
28554  goto bad;
28555  }
28556  }
28557  } else {
28558  PyErr_SetString(PyExc_TypeError,
28559  "raise: exception class must be a subclass of BaseException");
28560  goto bad;
28561  }
28562  if (cause) {
28563  PyObject *fixed_cause;
28564  if (cause == Py_None) {
28565  fixed_cause = NULL;
28566  } else if (PyExceptionClass_Check(cause)) {
28567  fixed_cause = PyObject_CallObject(cause, NULL);
28568  if (fixed_cause == NULL)
28569  goto bad;
28570  } else if (PyExceptionInstance_Check(cause)) {
28571  fixed_cause = cause;
28572  Py_INCREF(fixed_cause);
28573  } else {
28574  PyErr_SetString(PyExc_TypeError,
28575  "exception causes must derive from "
28576  "BaseException");
28577  goto bad;
28578  }
28579  PyException_SetCause(value, fixed_cause);
28580  }
28581  PyErr_SetObject(type, value);
28582  if (tb) {
28583 #if CYTHON_COMPILING_IN_PYPY
28584  PyObject *tmp_type, *tmp_value, *tmp_tb;
28585  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
28586  Py_INCREF(tb);
28587  PyErr_Restore(tmp_type, tmp_value, tb);
28588  Py_XDECREF(tmp_tb);
28589 #else
28590  PyThreadState *tstate = __Pyx_PyThreadState_Current;
28591  PyObject* tmp_tb = tstate->curexc_traceback;
28592  if (tb != tmp_tb) {
28593  Py_INCREF(tb);
28594  tstate->curexc_traceback = tb;
28595  Py_XDECREF(tmp_tb);
28596  }
28597 #endif
28598  }
28599 bad:
28600  Py_XDECREF(owned_instance);
28601  return;
28602 }
28603 #endif
28604 
28605 /* PyIntCompare */
28606 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
28607  if (op1 == op2) {
28608  Py_RETURN_FALSE;
28609  }
28610  #if PY_MAJOR_VERSION < 3
28611  if (likely(PyInt_CheckExact(op1))) {
28612  const long b = intval;
28613  long a = PyInt_AS_LONG(op1);
28614  if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28615  }
28616  #endif
28617  #if CYTHON_USE_PYLONG_INTERNALS
28618  if (likely(PyLong_CheckExact(op1))) {
28619  int unequal;
28620  unsigned long uintval;
28621  Py_ssize_t size = Py_SIZE(op1);
28622  const digit* digits = ((PyLongObject*)op1)->ob_digit;
28623  if (intval == 0) {
28624  if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28625  } else if (intval < 0) {
28626  if (size >= 0)
28627  Py_RETURN_TRUE;
28628  intval = -intval;
28629  size = -size;
28630  } else {
28631  if (size <= 0)
28632  Py_RETURN_TRUE;
28633  }
28634  uintval = (unsigned long) intval;
28635 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
28636  if (uintval >> (PyLong_SHIFT * 4)) {
28637  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28638  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28639  } else
28640 #endif
28641 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
28642  if (uintval >> (PyLong_SHIFT * 3)) {
28643  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28644  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28645  } else
28646 #endif
28647 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
28648  if (uintval >> (PyLong_SHIFT * 2)) {
28649  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28650  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28651  } else
28652 #endif
28653 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
28654  if (uintval >> (PyLong_SHIFT * 1)) {
28655  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
28656  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
28657  } else
28658 #endif
28659  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
28660  if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28661  }
28662  #endif
28663  if (PyFloat_CheckExact(op1)) {
28664  const long b = intval;
28665  double a = PyFloat_AS_DOUBLE(op1);
28666  if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
28667  }
28668  return (
28669  PyObject_RichCompare(op1, op2, Py_NE));
28670 }
28671 
28672 /* BytesEquals */
28673 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
28674 #if CYTHON_COMPILING_IN_PYPY
28675  return PyObject_RichCompareBool(s1, s2, equals);
28676 #else
28677  if (s1 == s2) {
28678  return (equals == Py_EQ);
28679  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28680  const char *ps1, *ps2;
28681  Py_ssize_t length = PyBytes_GET_SIZE(s1);
28682  if (length != PyBytes_GET_SIZE(s2))
28683  return (equals == Py_NE);
28684  ps1 = PyBytes_AS_STRING(s1);
28685  ps2 = PyBytes_AS_STRING(s2);
28686  if (ps1[0] != ps2[0]) {
28687  return (equals == Py_NE);
28688  } else if (length == 1) {
28689  return (equals == Py_EQ);
28690  } else {
28691  int result;
28692 #if CYTHON_USE_UNICODE_INTERNALS
28693  Py_hash_t hash1, hash2;
28694  hash1 = ((PyBytesObject*)s1)->ob_shash;
28695  hash2 = ((PyBytesObject*)s2)->ob_shash;
28696  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28697  return (equals == Py_NE);
28698  }
28699 #endif
28700  result = memcmp(ps1, ps2, (size_t)length);
28701  return (equals == Py_EQ) ? (result == 0) : (result != 0);
28702  }
28703  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28704  return (equals == Py_NE);
28705  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28706  return (equals == Py_NE);
28707  } else {
28708  int result;
28709  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28710  if (!py_result)
28711  return -1;
28712  result = __Pyx_PyObject_IsTrue(py_result);
28713  Py_DECREF(py_result);
28714  return result;
28715  }
28716 #endif
28717 }
28718 
28719 /* PyDictVersioning */
28720 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
28721 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
28722  PyObject *dict = Py_TYPE(obj)->tp_dict;
28723  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
28724 }
28725 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
28726  PyObject **dictptr = NULL;
28727  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
28728  if (offset) {
28729 #if CYTHON_COMPILING_IN_CPYTHON
28730  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
28731 #else
28732  dictptr = _PyObject_GetDictPtr(obj);
28733 #endif
28734  }
28735  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
28736 }
28737 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
28738  PyObject *dict = Py_TYPE(obj)->tp_dict;
28739  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
28740  return 0;
28741  return obj_dict_version == __Pyx_get_object_dict_version(obj);
28742 }
28743 #endif
28744 
28745 /* GetModuleGlobalName */
28746 #if CYTHON_USE_DICT_VERSIONS
28747 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
28748 #else
28749 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
28750 #endif
28751 {
28752  PyObject *result;
28753 #if !CYTHON_AVOID_BORROWED_REFS
28754 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
28755  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
28756  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28757  if (likely(result)) {
28758  return __Pyx_NewRef(result);
28759  } else if (unlikely(PyErr_Occurred())) {
28760  return NULL;
28761  }
28762 #else
28763  result = PyDict_GetItem(__pyx_d, name);
28764  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28765  if (likely(result)) {
28766  return __Pyx_NewRef(result);
28767  }
28768 #endif
28769 #else
28770  result = PyObject_GetItem(__pyx_d, name);
28771  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28772  if (likely(result)) {
28773  return __Pyx_NewRef(result);
28774  }
28775  PyErr_Clear();
28776 #endif
28777  return __Pyx_GetBuiltinName(name);
28778 }
28779 
28780 /* PyCFunctionFastCall */
28781 #if CYTHON_FAST_PYCCALL
28782 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
28783  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
28784  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
28785  PyObject *self = PyCFunction_GET_SELF(func);
28786  int flags = PyCFunction_GET_FLAGS(func);
28787  assert(PyCFunction_Check(func));
28788  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
28789  assert(nargs >= 0);
28790  assert(nargs == 0 || args != NULL);
28791  /* _PyCFunction_FastCallDict() must not be called with an exception set,
28792  because it may clear it (directly or indirectly) and so the
28793  caller loses its exception */
28794  assert(!PyErr_Occurred());
28795  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
28796  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
28797  } else {
28798  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
28799  }
28800 }
28801 #endif
28802 
28803 /* PyFunctionFastCall */
28804 #if CYTHON_FAST_PYCALL
28805 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
28806  PyObject *globals) {
28807  PyFrameObject *f;
28808  PyThreadState *tstate = __Pyx_PyThreadState_Current;
28809  PyObject **fastlocals;
28810  Py_ssize_t i;
28811  PyObject *result;
28812  assert(globals != NULL);
28813  /* XXX Perhaps we should create a specialized
28814  PyFrame_New() that doesn't take locals, but does
28815  take builtins without sanity checking them.
28816  */
28817  assert(tstate != NULL);
28818  f = PyFrame_New(tstate, co, globals, NULL);
28819  if (f == NULL) {
28820  return NULL;
28821  }
28822  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
28823  for (i = 0; i < na; i++) {
28824  Py_INCREF(*args);
28825  fastlocals[i] = *args++;
28826  }
28827  result = PyEval_EvalFrameEx(f,0);
28828  ++tstate->recursion_depth;
28829  Py_DECREF(f);
28830  --tstate->recursion_depth;
28831  return result;
28832 }
28833 #if 1 || PY_VERSION_HEX < 0x030600B1
28834 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
28835  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
28836  PyObject *globals = PyFunction_GET_GLOBALS(func);
28837  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
28838  PyObject *closure;
28839 #if PY_MAJOR_VERSION >= 3
28840  PyObject *kwdefs;
28841 #endif
28842  PyObject *kwtuple, **k;
28843  PyObject **d;
28844  Py_ssize_t nd;
28845  Py_ssize_t nk;
28846  PyObject *result;
28847  assert(kwargs == NULL || PyDict_Check(kwargs));
28848  nk = kwargs ? PyDict_Size(kwargs) : 0;
28849  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
28850  return NULL;
28851  }
28852  if (
28853 #if PY_MAJOR_VERSION >= 3
28854  co->co_kwonlyargcount == 0 &&
28855 #endif
28856  likely(kwargs == NULL || nk == 0) &&
28857  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
28858  if (argdefs == NULL && co->co_argcount == nargs) {
28859  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
28860  goto done;
28861  }
28862  else if (nargs == 0 && argdefs != NULL
28863  && co->co_argcount == Py_SIZE(argdefs)) {
28864  /* function called with no arguments, but all parameters have
28865  a default value: use default values as arguments .*/
28866  args = &PyTuple_GET_ITEM(argdefs, 0);
28867  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
28868  goto done;
28869  }
28870  }
28871  if (kwargs != NULL) {
28872  Py_ssize_t pos, i;
28873  kwtuple = PyTuple_New(2 * nk);
28874  if (kwtuple == NULL) {
28875  result = NULL;
28876  goto done;
28877  }
28878  k = &PyTuple_GET_ITEM(kwtuple, 0);
28879  pos = i = 0;
28880  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
28881  Py_INCREF(k[i]);
28882  Py_INCREF(k[i+1]);
28883  i += 2;
28884  }
28885  nk = i / 2;
28886  }
28887  else {
28888  kwtuple = NULL;
28889  k = NULL;
28890  }
28891  closure = PyFunction_GET_CLOSURE(func);
28892 #if PY_MAJOR_VERSION >= 3
28893  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
28894 #endif
28895  if (argdefs != NULL) {
28896  d = &PyTuple_GET_ITEM(argdefs, 0);
28897  nd = Py_SIZE(argdefs);
28898  }
28899  else {
28900  d = NULL;
28901  nd = 0;
28902  }
28903 #if PY_MAJOR_VERSION >= 3
28904  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
28905  args, (int)nargs,
28906  k, (int)nk,
28907  d, (int)nd, kwdefs, closure);
28908 #else
28909  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
28910  args, (int)nargs,
28911  k, (int)nk,
28912  d, (int)nd, closure);
28913 #endif
28914  Py_XDECREF(kwtuple);
28915 done:
28916  Py_LeaveRecursiveCall();
28917  return result;
28918 }
28919 #endif
28920 #endif
28921 
28922 /* PyObjectCall2Args */
28923 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
28924  PyObject *args, *result = NULL;
28925  #if CYTHON_FAST_PYCALL
28926  if (PyFunction_Check(function)) {
28927  PyObject *args[2] = {arg1, arg2};
28928  return __Pyx_PyFunction_FastCall(function, args, 2);
28929  }
28930  #endif
28931  #if CYTHON_FAST_PYCCALL
28932  if (__Pyx_PyFastCFunction_Check(function)) {
28933  PyObject *args[2] = {arg1, arg2};
28934  return __Pyx_PyCFunction_FastCall(function, args, 2);
28935  }
28936  #endif
28937  args = PyTuple_New(2);
28938  if (unlikely(!args)) goto done;
28939  Py_INCREF(arg1);
28940  PyTuple_SET_ITEM(args, 0, arg1);
28941  Py_INCREF(arg2);
28942  PyTuple_SET_ITEM(args, 1, arg2);
28943  Py_INCREF(function);
28944  result = __Pyx_PyObject_Call(function, args, NULL);
28945  Py_DECREF(args);
28946  Py_DECREF(function);
28947 done:
28948  return result;
28949 }
28950 
28951 /* PyObjectCallMethO */
28952 #if CYTHON_COMPILING_IN_CPYTHON
28953 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28954  PyObject *self, *result;
28955  PyCFunction cfunc;
28956  cfunc = PyCFunction_GET_FUNCTION(func);
28957  self = PyCFunction_GET_SELF(func);
28958  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28959  return NULL;
28960  result = cfunc(self, arg);
28961  Py_LeaveRecursiveCall();
28962  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28963  PyErr_SetString(
28964  PyExc_SystemError,
28965  "NULL result without error in PyObject_Call");
28966  }
28967  return result;
28968 }
28969 #endif
28970 
28971 /* PyObjectCallOneArg */
28972 #if CYTHON_COMPILING_IN_CPYTHON
28973 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28974  PyObject *result;
28975  PyObject *args = PyTuple_New(1);
28976  if (unlikely(!args)) return NULL;
28977  Py_INCREF(arg);
28978  PyTuple_SET_ITEM(args, 0, arg);
28979  result = __Pyx_PyObject_Call(func, args, NULL);
28980  Py_DECREF(args);
28981  return result;
28982 }
28983 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28984 #if CYTHON_FAST_PYCALL
28985  if (PyFunction_Check(func)) {
28986  return __Pyx_PyFunction_FastCall(func, &arg, 1);
28987  }
28988 #endif
28989  if (likely(PyCFunction_Check(func))) {
28990  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
28991  return __Pyx_PyObject_CallMethO(func, arg);
28992 #if CYTHON_FAST_PYCCALL
28993  } else if (__Pyx_PyFastCFunction_Check(func)) {
28994  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
28995 #endif
28996  }
28997  }
28998  return __Pyx__PyObject_CallOneArg(func, arg);
28999 }
29000 #else
29001 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29002  PyObject *result;
29003  PyObject *args = PyTuple_Pack(1, arg);
29004  if (unlikely(!args)) return NULL;
29005  result = __Pyx_PyObject_Call(func, args, NULL);
29006  Py_DECREF(args);
29007  return result;
29008 }
29009 #endif
29010 
29011 /* PyObjectCallNoArg */
29012 #if CYTHON_COMPILING_IN_CPYTHON
29013 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
29014 #if CYTHON_FAST_PYCALL
29015  if (PyFunction_Check(func)) {
29016  return __Pyx_PyFunction_FastCall(func, NULL, 0);
29017  }
29018 #endif
29019 #ifdef __Pyx_CyFunction_USED
29020  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
29021 #else
29022  if (likely(PyCFunction_Check(func)))
29023 #endif
29024  {
29025  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
29026  return __Pyx_PyObject_CallMethO(func, NULL);
29027  }
29028  }
29029  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
29030 }
29031 #endif
29032 
29033 /* GetItemInt */
29034 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29035  PyObject *r;
29036  if (!j) return NULL;
29037  r = PyObject_GetItem(o, j);
29038  Py_DECREF(j);
29039  return r;
29040 }
29041 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29042  CYTHON_NCP_UNUSED int wraparound,
29043  CYTHON_NCP_UNUSED int boundscheck) {
29044 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29045  Py_ssize_t wrapped_i = i;
29046  if (wraparound & unlikely(i < 0)) {
29047  wrapped_i += PyList_GET_SIZE(o);
29048  }
29049  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29050  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29051  Py_INCREF(r);
29052  return r;
29053  }
29054  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29055 #else
29056  return PySequence_GetItem(o, i);
29057 #endif
29058 }
29059 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29060  CYTHON_NCP_UNUSED int wraparound,
29061  CYTHON_NCP_UNUSED int boundscheck) {
29062 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29063  Py_ssize_t wrapped_i = i;
29064  if (wraparound & unlikely(i < 0)) {
29065  wrapped_i += PyTuple_GET_SIZE(o);
29066  }
29067  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29068  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29069  Py_INCREF(r);
29070  return r;
29071  }
29072  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29073 #else
29074  return PySequence_GetItem(o, i);
29075 #endif
29076 }
29077 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29078  CYTHON_NCP_UNUSED int wraparound,
29079  CYTHON_NCP_UNUSED int boundscheck) {
29080 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29081  if (is_list || PyList_CheckExact(o)) {
29082  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29083  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29084  PyObject *r = PyList_GET_ITEM(o, n);
29085  Py_INCREF(r);
29086  return r;
29087  }
29088  }
29089  else if (PyTuple_CheckExact(o)) {
29090  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29091  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29092  PyObject *r = PyTuple_GET_ITEM(o, n);
29093  Py_INCREF(r);
29094  return r;
29095  }
29096  } else {
29097  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
29098  if (likely(m && m->sq_item)) {
29099  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
29100  Py_ssize_t l = m->sq_length(o);
29101  if (likely(l >= 0)) {
29102  i += l;
29103  } else {
29104  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29105  return NULL;
29106  PyErr_Clear();
29107  }
29108  }
29109  return m->sq_item(o, i);
29110  }
29111  }
29112 #else
29113  if (is_list || PySequence_Check(o)) {
29114  return PySequence_GetItem(o, i);
29115  }
29116 #endif
29117  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29118 }
29119 
29120 /* DictGetItem */
29121 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
29122 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
29123  PyObject *value;
29124  value = PyDict_GetItemWithError(d, key);
29125  if (unlikely(!value)) {
29126  if (!PyErr_Occurred()) {
29127  if (unlikely(PyTuple_Check(key))) {
29128  PyObject* args = PyTuple_Pack(1, key);
29129  if (likely(args)) {
29130  PyErr_SetObject(PyExc_KeyError, args);
29131  Py_DECREF(args);
29132  }
29133  } else {
29134  PyErr_SetObject(PyExc_KeyError, key);
29135  }
29136  }
29137  return NULL;
29138  }
29139  Py_INCREF(value);
29140  return value;
29141 }
29142 #endif
29143 
29144 /* MemviewSliceInit */
29145 static int
29146 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
29147  int ndim,
29148  __Pyx_memviewslice *memviewslice,
29149  int memview_is_new_reference)
29150 {
29151  __Pyx_RefNannyDeclarations
29152  int i, retval=-1;
29153  Py_buffer *buf = &memview->view;
29154  __Pyx_RefNannySetupContext("init_memviewslice", 0);
29155  if (unlikely(memviewslice->memview || memviewslice->data)) {
29156  PyErr_SetString(PyExc_ValueError,
29157  "memviewslice is already initialized!");
29158  goto fail;
29159  }
29160  if (buf->strides) {
29161  for (i = 0; i < ndim; i++) {
29162  memviewslice->strides[i] = buf->strides[i];
29163  }
29164  } else {
29165  Py_ssize_t stride = buf->itemsize;
29166  for (i = ndim - 1; i >= 0; i--) {
29167  memviewslice->strides[i] = stride;
29168  stride *= buf->shape[i];
29169  }
29170  }
29171  for (i = 0; i < ndim; i++) {
29172  memviewslice->shape[i] = buf->shape[i];
29173  if (buf->suboffsets) {
29174  memviewslice->suboffsets[i] = buf->suboffsets[i];
29175  } else {
29176  memviewslice->suboffsets[i] = -1;
29177  }
29178  }
29179  memviewslice->memview = memview;
29180  memviewslice->data = (char *)buf->buf;
29181  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
29182  Py_INCREF(memview);
29183  }
29184  retval = 0;
29185  goto no_fail;
29186 fail:
29187  memviewslice->memview = 0;
29188  memviewslice->data = 0;
29189  retval = -1;
29190 no_fail:
29191  __Pyx_RefNannyFinishContext();
29192  return retval;
29193 }
29194 #ifndef Py_NO_RETURN
29195 #define Py_NO_RETURN
29196 #endif
29197 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
29198  va_list vargs;
29199  char msg[200];
29200 #ifdef HAVE_STDARG_PROTOTYPES
29201  va_start(vargs, fmt);
29202 #else
29203  va_start(vargs);
29204 #endif
29205  vsnprintf(msg, 200, fmt, vargs);
29206  va_end(vargs);
29207  Py_FatalError(msg);
29208 }
29209 static CYTHON_INLINE int
29210 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29211  PyThread_type_lock lock)
29212 {
29213  int result;
29214  PyThread_acquire_lock(lock, 1);
29215  result = (*acquisition_count)++;
29216  PyThread_release_lock(lock);
29217  return result;
29218 }
29219 static CYTHON_INLINE int
29220 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29221  PyThread_type_lock lock)
29222 {
29223  int result;
29224  PyThread_acquire_lock(lock, 1);
29225  result = (*acquisition_count)--;
29226  PyThread_release_lock(lock);
29227  return result;
29228 }
29229 static CYTHON_INLINE void
29230 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
29231 {
29232  int first_time;
29233  struct __pyx_memoryview_obj *memview = memslice->memview;
29234  if (unlikely(!memview || (PyObject *) memview == Py_None))
29235  return;
29236  if (unlikely(__pyx_get_slice_count(memview) < 0))
29237  __pyx_fatalerror("Acquisition count is %d (line %d)",
29238  __pyx_get_slice_count(memview), lineno);
29239  first_time = __pyx_add_acquisition_count(memview) == 0;
29240  if (unlikely(first_time)) {
29241  if (have_gil) {
29242  Py_INCREF((PyObject *) memview);
29243  } else {
29244  PyGILState_STATE _gilstate = PyGILState_Ensure();
29245  Py_INCREF((PyObject *) memview);
29246  PyGILState_Release(_gilstate);
29247  }
29248  }
29249 }
29250 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
29251  int have_gil, int lineno) {
29252  int last_time;
29253  struct __pyx_memoryview_obj *memview = memslice->memview;
29254  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
29255  memslice->memview = NULL;
29256  return;
29257  }
29258  if (unlikely(__pyx_get_slice_count(memview) <= 0))
29259  __pyx_fatalerror("Acquisition count is %d (line %d)",
29260  __pyx_get_slice_count(memview), lineno);
29261  last_time = __pyx_sub_acquisition_count(memview) == 1;
29262  memslice->data = NULL;
29263  if (unlikely(last_time)) {
29264  if (have_gil) {
29265  Py_CLEAR(memslice->memview);
29266  } else {
29267  PyGILState_STATE _gilstate = PyGILState_Ensure();
29268  Py_CLEAR(memslice->memview);
29269  PyGILState_Release(_gilstate);
29270  }
29271  } else {
29272  memslice->memview = NULL;
29273  }
29274 }
29275 
29276 /* ArgTypeTest */
29277 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
29278 {
29279  if (unlikely(!type)) {
29280  PyErr_SetString(PyExc_SystemError, "Missing type object");
29281  return 0;
29282  }
29283  else if (exact) {
29284  #if PY_MAJOR_VERSION == 2
29285  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
29286  #endif
29287  }
29288  else {
29289  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
29290  }
29291  PyErr_Format(PyExc_TypeError,
29292  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
29293  name, type->tp_name, Py_TYPE(obj)->tp_name);
29294  return 0;
29295 }
29296 
29297 /* UnicodeEquals */
29298 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
29299 #if CYTHON_COMPILING_IN_PYPY
29300  return PyObject_RichCompareBool(s1, s2, equals);
29301 #else
29302 #if PY_MAJOR_VERSION < 3
29303  PyObject* owned_ref = NULL;
29304 #endif
29305  int s1_is_unicode, s2_is_unicode;
29306  if (s1 == s2) {
29307  goto return_eq;
29308  }
29309  s1_is_unicode = PyUnicode_CheckExact(s1);
29310  s2_is_unicode = PyUnicode_CheckExact(s2);
29311 #if PY_MAJOR_VERSION < 3
29312  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
29313  owned_ref = PyUnicode_FromObject(s2);
29314  if (unlikely(!owned_ref))
29315  return -1;
29316  s2 = owned_ref;
29317  s2_is_unicode = 1;
29318  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
29319  owned_ref = PyUnicode_FromObject(s1);
29320  if (unlikely(!owned_ref))
29321  return -1;
29322  s1 = owned_ref;
29323  s1_is_unicode = 1;
29324  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
29325  return __Pyx_PyBytes_Equals(s1, s2, equals);
29326  }
29327 #endif
29328  if (s1_is_unicode & s2_is_unicode) {
29329  Py_ssize_t length;
29330  int kind;
29331  void *data1, *data2;
29332  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
29333  return -1;
29334  length = __Pyx_PyUnicode_GET_LENGTH(s1);
29335  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
29336  goto return_ne;
29337  }
29338 #if CYTHON_USE_UNICODE_INTERNALS
29339  {
29340  Py_hash_t hash1, hash2;
29341  #if CYTHON_PEP393_ENABLED
29342  hash1 = ((PyASCIIObject*)s1)->hash;
29343  hash2 = ((PyASCIIObject*)s2)->hash;
29344  #else
29345  hash1 = ((PyUnicodeObject*)s1)->hash;
29346  hash2 = ((PyUnicodeObject*)s2)->hash;
29347  #endif
29348  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
29349  goto return_ne;
29350  }
29351  }
29352 #endif
29353  kind = __Pyx_PyUnicode_KIND(s1);
29354  if (kind != __Pyx_PyUnicode_KIND(s2)) {
29355  goto return_ne;
29356  }
29357  data1 = __Pyx_PyUnicode_DATA(s1);
29358  data2 = __Pyx_PyUnicode_DATA(s2);
29359  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
29360  goto return_ne;
29361  } else if (length == 1) {
29362  goto return_eq;
29363  } else {
29364  int result = memcmp(data1, data2, (size_t)(length * kind));
29365  #if PY_MAJOR_VERSION < 3
29366  Py_XDECREF(owned_ref);
29367  #endif
29368  return (equals == Py_EQ) ? (result == 0) : (result != 0);
29369  }
29370  } else if ((s1 == Py_None) & s2_is_unicode) {
29371  goto return_ne;
29372  } else if ((s2 == Py_None) & s1_is_unicode) {
29373  goto return_ne;
29374  } else {
29375  int result;
29376  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
29377  #if PY_MAJOR_VERSION < 3
29378  Py_XDECREF(owned_ref);
29379  #endif
29380  if (!py_result)
29381  return -1;
29382  result = __Pyx_PyObject_IsTrue(py_result);
29383  Py_DECREF(py_result);
29384  return result;
29385  }
29386 return_eq:
29387  #if PY_MAJOR_VERSION < 3
29388  Py_XDECREF(owned_ref);
29389  #endif
29390  return (equals == Py_EQ);
29391 return_ne:
29392  #if PY_MAJOR_VERSION < 3
29393  Py_XDECREF(owned_ref);
29394  #endif
29395  return (equals == Py_NE);
29396 #endif
29397 }
29398 
29399 /* WriteUnraisableException */
29400 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
29401  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
29402  int full_traceback, CYTHON_UNUSED int nogil) {
29403  PyObject *old_exc, *old_val, *old_tb;
29404  PyObject *ctx;
29405  __Pyx_PyThreadState_declare
29406 #ifdef WITH_THREAD
29407  PyGILState_STATE state;
29408  if (nogil)
29409  state = PyGILState_Ensure();
29410 #ifdef _MSC_VER
29411  else state = (PyGILState_STATE)-1;
29412 #endif
29413 #endif
29414  __Pyx_PyThreadState_assign
29415  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
29416  if (full_traceback) {
29417  Py_XINCREF(old_exc);
29418  Py_XINCREF(old_val);
29419  Py_XINCREF(old_tb);
29420  __Pyx_ErrRestore(old_exc, old_val, old_tb);
29421  PyErr_PrintEx(1);
29422  }
29423  #if PY_MAJOR_VERSION < 3
29424  ctx = PyString_FromString(name);
29425  #else
29426  ctx = PyUnicode_FromString(name);
29427  #endif
29428  __Pyx_ErrRestore(old_exc, old_val, old_tb);
29429  if (!ctx) {
29430  PyErr_WriteUnraisable(Py_None);
29431  } else {
29432  PyErr_WriteUnraisable(ctx);
29433  Py_DECREF(ctx);
29434  }
29435 #ifdef WITH_THREAD
29436  if (nogil)
29437  PyGILState_Release(state);
29438 #endif
29439 }
29440 
29441 /* GetAttr */
29442 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29443 #if CYTHON_USE_TYPE_SLOTS
29444 #if PY_MAJOR_VERSION >= 3
29445  if (likely(PyUnicode_Check(n)))
29446 #else
29447  if (likely(PyString_Check(n)))
29448 #endif
29449  return __Pyx_PyObject_GetAttrStr(o, n);
29450 #endif
29451  return PyObject_GetAttr(o, n);
29452 }
29453 
29454 /* ObjectGetItem */
29455 #if CYTHON_USE_TYPE_SLOTS
29456 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
29457  PyObject *runerr;
29458  Py_ssize_t key_value;
29459  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
29460  if (unlikely(!(m && m->sq_item))) {
29461  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
29462  return NULL;
29463  }
29464  key_value = __Pyx_PyIndex_AsSsize_t(index);
29465  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29466  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29467  }
29468  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29469  PyErr_Clear();
29470  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
29471  }
29472  return NULL;
29473 }
29474 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
29475  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
29476  if (likely(m && m->mp_subscript)) {
29477  return m->mp_subscript(obj, key);
29478  }
29479  return __Pyx_PyObject_GetIndex(obj, key);
29480 }
29481 #endif
29482 
29483 /* decode_c_string */
29484 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
29485  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
29486  const char* encoding, const char* errors,
29487  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
29488  Py_ssize_t length;
29489  if (unlikely((start < 0) | (stop < 0))) {
29490  size_t slen = strlen(cstring);
29491  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
29492  PyErr_SetString(PyExc_OverflowError,
29493  "c-string too long to convert to Python");
29494  return NULL;
29495  }
29496  length = (Py_ssize_t) slen;
29497  if (start < 0) {
29498  start += length;
29499  if (start < 0)
29500  start = 0;
29501  }
29502  if (stop < 0)
29503  stop += length;
29504  }
29505  if (unlikely(stop <= start))
29506  return __Pyx_NewRef(__pyx_empty_unicode);
29507  length = stop - start;
29508  cstring += start;
29509  if (decode_func) {
29510  return decode_func(cstring, length, errors);
29511  } else {
29512  return PyUnicode_Decode(cstring, length, encoding, errors);
29513  }
29514 }
29515 
29516 /* PyErrExceptionMatches */
29517 #if CYTHON_FAST_THREAD_STATE
29518 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29519  Py_ssize_t i, n;
29520  n = PyTuple_GET_SIZE(tuple);
29521 #if PY_MAJOR_VERSION >= 3
29522  for (i=0; i<n; i++) {
29523  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
29524  }
29525 #endif
29526  for (i=0; i<n; i++) {
29527  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
29528  }
29529  return 0;
29530 }
29531 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
29532  PyObject *exc_type = tstate->curexc_type;
29533  if (exc_type == err) return 1;
29534  if (unlikely(!exc_type)) return 0;
29535  if (unlikely(PyTuple_Check(err)))
29536  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29537  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
29538 }
29539 #endif
29540 
29541 /* GetAttr3 */
29542 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
29543  __Pyx_PyThreadState_declare
29544  __Pyx_PyThreadState_assign
29545  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29546  return NULL;
29547  __Pyx_PyErr_Clear();
29548  Py_INCREF(d);
29549  return d;
29550 }
29551 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
29552  PyObject *r = __Pyx_GetAttr(o, n);
29553  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
29554 }
29555 
29556 /* RaiseTooManyValuesToUnpack */
29557 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29558  PyErr_Format(PyExc_ValueError,
29559  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
29560 }
29561 
29562 /* RaiseNeedMoreValuesToUnpack */
29563 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29564  PyErr_Format(PyExc_ValueError,
29565  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
29566  index, (index == 1) ? "" : "s");
29567 }
29568 
29569 /* RaiseNoneIterError */
29570 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
29571  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
29572 }
29573 
29574 /* ExtTypeTest */
29575 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
29576  if (unlikely(!type)) {
29577  PyErr_SetString(PyExc_SystemError, "Missing type object");
29578  return 0;
29579  }
29580  if (likely(__Pyx_TypeCheck(obj, type)))
29581  return 1;
29582  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
29583  Py_TYPE(obj)->tp_name, type->tp_name);
29584  return 0;
29585 }
29586 
29587 /* GetTopmostException */
29588 #if CYTHON_USE_EXC_INFO_STACK
29589 static _PyErr_StackItem *
29590 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29591 {
29592  _PyErr_StackItem *exc_info = tstate->exc_info;
29593  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
29594  exc_info->previous_item != NULL)
29595  {
29596  exc_info = exc_info->previous_item;
29597  }
29598  return exc_info;
29599 }
29600 #endif
29601 
29602 /* SaveResetException */
29603 #if CYTHON_FAST_THREAD_STATE
29604 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29605  #if CYTHON_USE_EXC_INFO_STACK
29606  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29607  *type = exc_info->exc_type;
29608  *value = exc_info->exc_value;
29609  *tb = exc_info->exc_traceback;
29610  #else
29611  *type = tstate->exc_type;
29612  *value = tstate->exc_value;
29613  *tb = tstate->exc_traceback;
29614  #endif
29615  Py_XINCREF(*type);
29616  Py_XINCREF(*value);
29617  Py_XINCREF(*tb);
29618 }
29619 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29620  PyObject *tmp_type, *tmp_value, *tmp_tb;
29621  #if CYTHON_USE_EXC_INFO_STACK
29622  _PyErr_StackItem *exc_info = tstate->exc_info;
29623  tmp_type = exc_info->exc_type;
29624  tmp_value = exc_info->exc_value;
29625  tmp_tb = exc_info->exc_traceback;
29626  exc_info->exc_type = type;
29627  exc_info->exc_value = value;
29628  exc_info->exc_traceback = tb;
29629  #else
29630  tmp_type = tstate->exc_type;
29631  tmp_value = tstate->exc_value;
29632  tmp_tb = tstate->exc_traceback;
29633  tstate->exc_type = type;
29634  tstate->exc_value = value;
29635  tstate->exc_traceback = tb;
29636  #endif
29637  Py_XDECREF(tmp_type);
29638  Py_XDECREF(tmp_value);
29639  Py_XDECREF(tmp_tb);
29640 }
29641 #endif
29642 
29643 /* GetException */
29644 #if CYTHON_FAST_THREAD_STATE
29645 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
29646 #else
29647 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
29648 #endif
29649 {
29650  PyObject *local_type, *local_value, *local_tb;
29651 #if CYTHON_FAST_THREAD_STATE
29652  PyObject *tmp_type, *tmp_value, *tmp_tb;
29653  local_type = tstate->curexc_type;
29654  local_value = tstate->curexc_value;
29655  local_tb = tstate->curexc_traceback;
29656  tstate->curexc_type = 0;
29657  tstate->curexc_value = 0;
29658  tstate->curexc_traceback = 0;
29659 #else
29660  PyErr_Fetch(&local_type, &local_value, &local_tb);
29661 #endif
29662  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
29663 #if CYTHON_FAST_THREAD_STATE
29664  if (unlikely(tstate->curexc_type))
29665 #else
29666  if (unlikely(PyErr_Occurred()))
29667 #endif
29668  goto bad;
29669  #if PY_MAJOR_VERSION >= 3
29670  if (local_tb) {
29671  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
29672  goto bad;
29673  }
29674  #endif
29675  Py_XINCREF(local_tb);
29676  Py_XINCREF(local_type);
29677  Py_XINCREF(local_value);
29678  *type = local_type;
29679  *value = local_value;
29680  *tb = local_tb;
29681 #if CYTHON_FAST_THREAD_STATE
29682  #if CYTHON_USE_EXC_INFO_STACK
29683  {
29684  _PyErr_StackItem *exc_info = tstate->exc_info;
29685  tmp_type = exc_info->exc_type;
29686  tmp_value = exc_info->exc_value;
29687  tmp_tb = exc_info->exc_traceback;
29688  exc_info->exc_type = local_type;
29689  exc_info->exc_value = local_value;
29690  exc_info->exc_traceback = local_tb;
29691  }
29692  #else
29693  tmp_type = tstate->exc_type;
29694  tmp_value = tstate->exc_value;
29695  tmp_tb = tstate->exc_traceback;
29696  tstate->exc_type = local_type;
29697  tstate->exc_value = local_value;
29698  tstate->exc_traceback = local_tb;
29699  #endif
29700  Py_XDECREF(tmp_type);
29701  Py_XDECREF(tmp_value);
29702  Py_XDECREF(tmp_tb);
29703 #else
29704  PyErr_SetExcInfo(local_type, local_value, local_tb);
29705 #endif
29706  return 0;
29707 bad:
29708  *type = 0;
29709  *value = 0;
29710  *tb = 0;
29711  Py_XDECREF(local_type);
29712  Py_XDECREF(local_value);
29713  Py_XDECREF(local_tb);
29714  return -1;
29715 }
29716 
29717 /* SwapException */
29718 #if CYTHON_FAST_THREAD_STATE
29719 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29720  PyObject *tmp_type, *tmp_value, *tmp_tb;
29721  #if CYTHON_USE_EXC_INFO_STACK
29722  _PyErr_StackItem *exc_info = tstate->exc_info;
29723  tmp_type = exc_info->exc_type;
29724  tmp_value = exc_info->exc_value;
29725  tmp_tb = exc_info->exc_traceback;
29726  exc_info->exc_type = *type;
29727  exc_info->exc_value = *value;
29728  exc_info->exc_traceback = *tb;
29729  #else
29730  tmp_type = tstate->exc_type;
29731  tmp_value = tstate->exc_value;
29732  tmp_tb = tstate->exc_traceback;
29733  tstate->exc_type = *type;
29734  tstate->exc_value = *value;
29735  tstate->exc_traceback = *tb;
29736  #endif
29737  *type = tmp_type;
29738  *value = tmp_value;
29739  *tb = tmp_tb;
29740 }
29741 #else
29742 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
29743  PyObject *tmp_type, *tmp_value, *tmp_tb;
29744  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
29745  PyErr_SetExcInfo(*type, *value, *tb);
29746  *type = tmp_type;
29747  *value = tmp_value;
29748  *tb = tmp_tb;
29749 }
29750 #endif
29751 
29752 /* Import */
29753 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
29754  PyObject *empty_list = 0;
29755  PyObject *module = 0;
29756  PyObject *global_dict = 0;
29757  PyObject *empty_dict = 0;
29758  PyObject *list;
29759  #if PY_MAJOR_VERSION < 3
29760  PyObject *py_import;
29761  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
29762  if (!py_import)
29763  goto bad;
29764  #endif
29765  if (from_list)
29766  list = from_list;
29767  else {
29768  empty_list = PyList_New(0);
29769  if (!empty_list)
29770  goto bad;
29771  list = empty_list;
29772  }
29773  global_dict = PyModule_GetDict(__pyx_m);
29774  if (!global_dict)
29775  goto bad;
29776  empty_dict = PyDict_New();
29777  if (!empty_dict)
29778  goto bad;
29779  {
29780  #if PY_MAJOR_VERSION >= 3
29781  if (level == -1) {
29782  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
29783  module = PyImport_ImportModuleLevelObject(
29784  name, global_dict, empty_dict, list, 1);
29785  if (!module) {
29786  if (!PyErr_ExceptionMatches(PyExc_ImportError))
29787  goto bad;
29788  PyErr_Clear();
29789  }
29790  }
29791  level = 0;
29792  }
29793  #endif
29794  if (!module) {
29795  #if PY_MAJOR_VERSION < 3
29796  PyObject *py_level = PyInt_FromLong(level);
29797  if (!py_level)
29798  goto bad;
29799  module = PyObject_CallFunctionObjArgs(py_import,
29800  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
29801  Py_DECREF(py_level);
29802  #else
29803  module = PyImport_ImportModuleLevelObject(
29804  name, global_dict, empty_dict, list, level);
29805  #endif
29806  }
29807  }
29808 bad:
29809  #if PY_MAJOR_VERSION < 3
29810  Py_XDECREF(py_import);
29811  #endif
29812  Py_XDECREF(empty_list);
29813  Py_XDECREF(empty_dict);
29814  return module;
29815 }
29816 
29817 /* FastTypeChecks */
29818 #if CYTHON_COMPILING_IN_CPYTHON
29819 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
29820  while (a) {
29821  a = a->tp_base;
29822  if (a == b)
29823  return 1;
29824  }
29825  return b == &PyBaseObject_Type;
29826 }
29827 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
29828  PyObject *mro;
29829  if (a == b) return 1;
29830  mro = a->tp_mro;
29831  if (likely(mro)) {
29832  Py_ssize_t i, n;
29833  n = PyTuple_GET_SIZE(mro);
29834  for (i = 0; i < n; i++) {
29835  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
29836  return 1;
29837  }
29838  return 0;
29839  }
29840  return __Pyx_InBases(a, b);
29841 }
29842 #if PY_MAJOR_VERSION == 2
29843 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
29844  PyObject *exception, *value, *tb;
29845  int res;
29846  __Pyx_PyThreadState_declare
29847  __Pyx_PyThreadState_assign
29848  __Pyx_ErrFetch(&exception, &value, &tb);
29849  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
29850  if (unlikely(res == -1)) {
29851  PyErr_WriteUnraisable(err);
29852  res = 0;
29853  }
29854  if (!res) {
29855  res = PyObject_IsSubclass(err, exc_type2);
29856  if (unlikely(res == -1)) {
29857  PyErr_WriteUnraisable(err);
29858  res = 0;
29859  }
29860  }
29861  __Pyx_ErrRestore(exception, value, tb);
29862  return res;
29863 }
29864 #else
29865 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
29866  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
29867  if (!res) {
29868  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
29869  }
29870  return res;
29871 }
29872 #endif
29873 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29874  Py_ssize_t i, n;
29875  assert(PyExceptionClass_Check(exc_type));
29876  n = PyTuple_GET_SIZE(tuple);
29877 #if PY_MAJOR_VERSION >= 3
29878  for (i=0; i<n; i++) {
29879  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
29880  }
29881 #endif
29882  for (i=0; i<n; i++) {
29883  PyObject *t = PyTuple_GET_ITEM(tuple, i);
29884  #if PY_MAJOR_VERSION < 3
29885  if (likely(exc_type == t)) return 1;
29886  #endif
29887  if (likely(PyExceptionClass_Check(t))) {
29888  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
29889  } else {
29890  }
29891  }
29892  return 0;
29893 }
29894 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
29895  if (likely(err == exc_type)) return 1;
29896  if (likely(PyExceptionClass_Check(err))) {
29897  if (likely(PyExceptionClass_Check(exc_type))) {
29898  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
29899  } else if (likely(PyTuple_Check(exc_type))) {
29900  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
29901  } else {
29902  }
29903  }
29904  return PyErr_GivenExceptionMatches(err, exc_type);
29905 }
29906 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
29907  assert(PyExceptionClass_Check(exc_type1));
29908  assert(PyExceptionClass_Check(exc_type2));
29909  if (likely(err == exc_type1 || err == exc_type2)) return 1;
29910  if (likely(PyExceptionClass_Check(err))) {
29911  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
29912  }
29913  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
29914 }
29915 #endif
29916 
29917 /* PyIntBinop */
29918 #if !CYTHON_COMPILING_IN_PYPY
29919 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
29920  (void)inplace;
29921  (void)zerodivision_check;
29922  #if PY_MAJOR_VERSION < 3
29923  if (likely(PyInt_CheckExact(op1))) {
29924  const long b = intval;
29925  long x;
29926  long a = PyInt_AS_LONG(op1);
29927  x = (long)((unsigned long)a + b);
29928  if (likely((x^a) >= 0 || (x^b) >= 0))
29929  return PyInt_FromLong(x);
29930  return PyLong_Type.tp_as_number->nb_add(op1, op2);
29931  }
29932  #endif
29933  #if CYTHON_USE_PYLONG_INTERNALS
29934  if (likely(PyLong_CheckExact(op1))) {
29935  const long b = intval;
29936  long a, x;
29937 #ifdef HAVE_LONG_LONG
29938  const PY_LONG_LONG llb = intval;
29939  PY_LONG_LONG lla, llx;
29940 #endif
29941  const digit* digits = ((PyLongObject*)op1)->ob_digit;
29942  const Py_ssize_t size = Py_SIZE(op1);
29943  if (likely(__Pyx_sst_abs(size) <= 1)) {
29944  a = likely(size) ? digits[0] : 0;
29945  if (size == -1) a = -a;
29946  } else {
29947  switch (size) {
29948  case -2:
29949  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29950  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29951  break;
29952 #ifdef HAVE_LONG_LONG
29953  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
29954  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
29955  goto long_long;
29956 #endif
29957  }
29958  CYTHON_FALLTHROUGH;
29959  case 2:
29960  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29961  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29962  break;
29963 #ifdef HAVE_LONG_LONG
29964  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
29965  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
29966  goto long_long;
29967 #endif
29968  }
29969  CYTHON_FALLTHROUGH;
29970  case -3:
29971  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29972  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29973  break;
29974 #ifdef HAVE_LONG_LONG
29975  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
29976  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
29977  goto long_long;
29978 #endif
29979  }
29980  CYTHON_FALLTHROUGH;
29981  case 3:
29982  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29983  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29984  break;
29985 #ifdef HAVE_LONG_LONG
29986  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
29987  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
29988  goto long_long;
29989 #endif
29990  }
29991  CYTHON_FALLTHROUGH;
29992  case -4:
29993  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
29994  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29995  break;
29996 #ifdef HAVE_LONG_LONG
29997  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
29998  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
29999  goto long_long;
30000 #endif
30001  }
30002  CYTHON_FALLTHROUGH;
30003  case 4:
30004  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30005  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30006  break;
30007 #ifdef HAVE_LONG_LONG
30008  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30009  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30010  goto long_long;
30011 #endif
30012  }
30013  CYTHON_FALLTHROUGH;
30014  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
30015  }
30016  }
30017  x = a + b;
30018  return PyLong_FromLong(x);
30019 #ifdef HAVE_LONG_LONG
30020  long_long:
30021  llx = lla + llb;
30022  return PyLong_FromLongLong(llx);
30023 #endif
30024 
30025 
30026  }
30027  #endif
30028  if (PyFloat_CheckExact(op1)) {
30029  const long b = intval;
30030  double a = PyFloat_AS_DOUBLE(op1);
30031  double result;
30032  PyFPE_START_PROTECT("add", return NULL)
30033  result = ((double)a) + (double)b;
30034  PyFPE_END_PROTECT(result)
30035  return PyFloat_FromDouble(result);
30036  }
30037  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30038 }
30039 #endif
30040 
30041 /* None */
30042 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
30043  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
30044 }
30045 
30046 /* ImportFrom */
30047 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30048  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30049  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30050  PyErr_Format(PyExc_ImportError,
30051  #if PY_MAJOR_VERSION < 3
30052  "cannot import name %.230s", PyString_AS_STRING(name));
30053  #else
30054  "cannot import name %S", name);
30055  #endif
30056  }
30057  return value;
30058 }
30059 
30060 /* HasAttr */
30061 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30062  PyObject *r;
30063  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30064  PyErr_SetString(PyExc_TypeError,
30065  "hasattr(): attribute name must be string");
30066  return -1;
30067  }
30068  r = __Pyx_GetAttr(o, n);
30069  if (unlikely(!r)) {
30070  PyErr_Clear();
30071  return 0;
30072  } else {
30073  Py_DECREF(r);
30074  return 1;
30075  }
30076 }
30077 
30078 /* CallNextTpDealloc */
30079 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
30080  PyTypeObject* type = Py_TYPE(obj);
30081  while (type && type->tp_dealloc != current_tp_dealloc)
30082  type = type->tp_base;
30083  while (type && type->tp_dealloc == current_tp_dealloc)
30084  type = type->tp_base;
30085  if (type)
30086  type->tp_dealloc(obj);
30087 }
30088 
30089 /* CallNextTpTraverse */
30090 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
30091  PyTypeObject* type = Py_TYPE(obj);
30092  while (type && type->tp_traverse != current_tp_traverse)
30093  type = type->tp_base;
30094  while (type && type->tp_traverse == current_tp_traverse)
30095  type = type->tp_base;
30096  if (type && type->tp_traverse)
30097  return type->tp_traverse(obj, v, a);
30098  return 0;
30099 }
30100 
30101 /* CallNextTpClear */
30102 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
30103  PyTypeObject* type = Py_TYPE(obj);
30104  while (type && type->tp_clear != current_tp_clear)
30105  type = type->tp_base;
30106  while (type && type->tp_clear == current_tp_clear)
30107  type = type->tp_base;
30108  if (type && type->tp_clear)
30109  type->tp_clear(obj);
30110 }
30111 
30112 /* PyObject_GenericGetAttrNoDict */
30113 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30114 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
30115  PyErr_Format(PyExc_AttributeError,
30116 #if PY_MAJOR_VERSION >= 3
30117  "'%.50s' object has no attribute '%U'",
30118  tp->tp_name, attr_name);
30119 #else
30120  "'%.50s' object has no attribute '%.400s'",
30121  tp->tp_name, PyString_AS_STRING(attr_name));
30122 #endif
30123  return NULL;
30124 }
30125 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
30126  PyObject *descr;
30127  PyTypeObject *tp = Py_TYPE(obj);
30128  if (unlikely(!PyString_Check(attr_name))) {
30129  return PyObject_GenericGetAttr(obj, attr_name);
30130  }
30131  assert(!tp->tp_dictoffset);
30132  descr = _PyType_Lookup(tp, attr_name);
30133  if (unlikely(!descr)) {
30134  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
30135  }
30136  Py_INCREF(descr);
30137  #if PY_MAJOR_VERSION < 3
30138  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
30139  #endif
30140  {
30141  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
30142  if (unlikely(f)) {
30143  PyObject *res = f(descr, obj, (PyObject *)tp);
30144  Py_DECREF(descr);
30145  return res;
30146  }
30147  }
30148  return descr;
30149 }
30150 #endif
30151 
30152 /* PyObject_GenericGetAttr */
30153 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30154 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
30155  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
30156  return PyObject_GenericGetAttr(obj, attr_name);
30157  }
30158  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
30159 }
30160 #endif
30161 
30162 /* TypeImport */
30163 #ifndef __PYX_HAVE_RT_ImportType
30164 #define __PYX_HAVE_RT_ImportType
30165 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
30166  size_t size, enum __Pyx_ImportType_CheckSize check_size)
30167 {
30168  PyObject *result = 0;
30169  char warning[200];
30170  Py_ssize_t basicsize;
30171 #ifdef Py_LIMITED_API
30172  PyObject *py_basicsize;
30173 #endif
30174  result = PyObject_GetAttrString(module, class_name);
30175  if (!result)
30176  goto bad;
30177  if (!PyType_Check(result)) {
30178  PyErr_Format(PyExc_TypeError,
30179  "%.200s.%.200s is not a type object",
30180  module_name, class_name);
30181  goto bad;
30182  }
30183 #ifndef Py_LIMITED_API
30184  basicsize = ((PyTypeObject *)result)->tp_basicsize;
30185 #else
30186  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
30187  if (!py_basicsize)
30188  goto bad;
30189  basicsize = PyLong_AsSsize_t(py_basicsize);
30190  Py_DECREF(py_basicsize);
30191  py_basicsize = 0;
30192  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
30193  goto bad;
30194 #endif
30195  if ((size_t)basicsize < size) {
30196  PyErr_Format(PyExc_ValueError,
30197  "%.200s.%.200s size changed, may indicate binary incompatibility. "
30198  "Expected %zd from C header, got %zd from PyObject",
30199  module_name, class_name, size, basicsize);
30200  goto bad;
30201  }
30202  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
30203  PyErr_Format(PyExc_ValueError,
30204  "%.200s.%.200s size changed, may indicate binary incompatibility. "
30205  "Expected %zd from C header, got %zd from PyObject",
30206  module_name, class_name, size, basicsize);
30207  goto bad;
30208  }
30209  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
30210  PyOS_snprintf(warning, sizeof(warning),
30211  "%s.%s size changed, may indicate binary incompatibility. "
30212  "Expected %zd from C header, got %zd from PyObject",
30213  module_name, class_name, size, basicsize);
30214  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
30215  }
30216  return (PyTypeObject *)result;
30217 bad:
30218  Py_XDECREF(result);
30219  return NULL;
30220 }
30221 #endif
30222 
30223 /* GetVTable */
30224 static void* __Pyx_GetVtable(PyObject *dict) {
30225  void* ptr;
30226  PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
30227  if (!ob)
30228  goto bad;
30229 #if PY_VERSION_HEX >= 0x02070000
30230  ptr = PyCapsule_GetPointer(ob, 0);
30231 #else
30232  ptr = PyCObject_AsVoidPtr(ob);
30233 #endif
30234  if (!ptr && !PyErr_Occurred())
30235  PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
30236  Py_DECREF(ob);
30237  return ptr;
30238 bad:
30239  Py_XDECREF(ob);
30240  return NULL;
30241 }
30242 
30243 /* SetVTable */
30244 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
30245 #if PY_VERSION_HEX >= 0x02070000
30246  PyObject *ob = PyCapsule_New(vtable, 0, 0);
30247 #else
30248  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
30249 #endif
30250  if (!ob)
30251  goto bad;
30252  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
30253  goto bad;
30254  Py_DECREF(ob);
30255  return 0;
30256 bad:
30257  Py_XDECREF(ob);
30258  return -1;
30259 }
30260 
30261 /* PyObjectGetAttrStrNoError */
30262 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
30263  __Pyx_PyThreadState_declare
30264  __Pyx_PyThreadState_assign
30265  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30266  __Pyx_PyErr_Clear();
30267 }
30268 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
30269  PyObject *result;
30270 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
30271  PyTypeObject* tp = Py_TYPE(obj);
30272  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
30273  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
30274  }
30275 #endif
30276  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
30277  if (unlikely(!result)) {
30278  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
30279  }
30280  return result;
30281 }
30282 
30283 /* SetupReduce */
30284 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
30285  int ret;
30286  PyObject *name_attr;
30287  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
30288  if (likely(name_attr)) {
30289  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
30290  } else {
30291  ret = -1;
30292  }
30293  if (unlikely(ret < 0)) {
30294  PyErr_Clear();
30295  ret = 0;
30296  }
30297  Py_XDECREF(name_attr);
30298  return ret;
30299 }
30300 static int __Pyx_setup_reduce(PyObject* type_obj) {
30301  int ret = 0;
30302  PyObject *object_reduce = NULL;
30303  PyObject *object_reduce_ex = NULL;
30304  PyObject *reduce = NULL;
30305  PyObject *reduce_ex = NULL;
30306  PyObject *reduce_cython = NULL;
30307  PyObject *setstate = NULL;
30308  PyObject *setstate_cython = NULL;
30309 #if CYTHON_USE_PYTYPE_LOOKUP
30310  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
30311 #else
30312  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
30313 #endif
30314 #if CYTHON_USE_PYTYPE_LOOKUP
30315  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
30316 #else
30317  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
30318 #endif
30319  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
30320  if (reduce_ex == object_reduce_ex) {
30321 #if CYTHON_USE_PYTYPE_LOOKUP
30322  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
30323 #else
30324  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
30325 #endif
30326  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
30327  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
30328  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
30329  if (likely(reduce_cython)) {
30330  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30331  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30332  } else if (reduce == object_reduce || PyErr_Occurred()) {
30333  goto __PYX_BAD;
30334  }
30335  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
30336  if (!setstate) PyErr_Clear();
30337  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
30338  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
30339  if (likely(setstate_cython)) {
30340  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30341  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
30342  } else if (!setstate || PyErr_Occurred()) {
30343  goto __PYX_BAD;
30344  }
30345  }
30346  PyType_Modified((PyTypeObject*)type_obj);
30347  }
30348  }
30349  goto __PYX_GOOD;
30350 __PYX_BAD:
30351  if (!PyErr_Occurred())
30352  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
30353  ret = -1;
30354 __PYX_GOOD:
30355 #if !CYTHON_USE_PYTYPE_LOOKUP
30356  Py_XDECREF(object_reduce);
30357  Py_XDECREF(object_reduce_ex);
30358 #endif
30359  Py_XDECREF(reduce);
30360  Py_XDECREF(reduce_ex);
30361  Py_XDECREF(reduce_cython);
30362  Py_XDECREF(setstate);
30363  Py_XDECREF(setstate_cython);
30364  return ret;
30365 }
30366 
30367 /* FetchCommonType */
30368 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
30369  PyObject* fake_module;
30370  PyTypeObject* cached_type = NULL;
30371  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
30372  if (!fake_module) return NULL;
30373  Py_INCREF(fake_module);
30374  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
30375  if (cached_type) {
30376  if (!PyType_Check((PyObject*)cached_type)) {
30377  PyErr_Format(PyExc_TypeError,
30378  "Shared Cython type %.200s is not a type object",
30379  type->tp_name);
30380  goto bad;
30381  }
30382  if (cached_type->tp_basicsize != type->tp_basicsize) {
30383  PyErr_Format(PyExc_TypeError,
30384  "Shared Cython type %.200s has the wrong size, try recompiling",
30385  type->tp_name);
30386  goto bad;
30387  }
30388  } else {
30389  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
30390  PyErr_Clear();
30391  if (PyType_Ready(type) < 0) goto bad;
30392  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
30393  goto bad;
30394  Py_INCREF(type);
30395  cached_type = type;
30396  }
30397 done:
30398  Py_DECREF(fake_module);
30399  return cached_type;
30400 bad:
30401  Py_XDECREF(cached_type);
30402  cached_type = NULL;
30403  goto done;
30404 }
30405 
30406 /* CythonFunctionShared */
30407 #include <structmember.h>
30408 static PyObject *
30409 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
30410 {
30411  if (unlikely(op->func_doc == NULL)) {
30412  if (op->func.m_ml->ml_doc) {
30413 #if PY_MAJOR_VERSION >= 3
30414  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
30415 #else
30416  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
30417 #endif
30418  if (unlikely(op->func_doc == NULL))
30419  return NULL;
30420  } else {
30421  Py_INCREF(Py_None);
30422  return Py_None;
30423  }
30424  }
30425  Py_INCREF(op->func_doc);
30426  return op->func_doc;
30427 }
30428 static int
30429 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30430 {
30431  PyObject *tmp = op->func_doc;
30432  if (value == NULL) {
30433  value = Py_None;
30434  }
30435  Py_INCREF(value);
30436  op->func_doc = value;
30437  Py_XDECREF(tmp);
30438  return 0;
30439 }
30440 static PyObject *
30441 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30442 {
30443  if (unlikely(op->func_name == NULL)) {
30444 #if PY_MAJOR_VERSION >= 3
30445  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
30446 #else
30447  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
30448 #endif
30449  if (unlikely(op->func_name == NULL))
30450  return NULL;
30451  }
30452  Py_INCREF(op->func_name);
30453  return op->func_name;
30454 }
30455 static int
30456 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30457 {
30458  PyObject *tmp;
30459 #if PY_MAJOR_VERSION >= 3
30460  if (unlikely(value == NULL || !PyUnicode_Check(value)))
30461 #else
30462  if (unlikely(value == NULL || !PyString_Check(value)))
30463 #endif
30464  {
30465  PyErr_SetString(PyExc_TypeError,
30466  "__name__ must be set to a string object");
30467  return -1;
30468  }
30469  tmp = op->func_name;
30470  Py_INCREF(value);
30471  op->func_name = value;
30472  Py_XDECREF(tmp);
30473  return 0;
30474 }
30475 static PyObject *
30476 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30477 {
30478  Py_INCREF(op->func_qualname);
30479  return op->func_qualname;
30480 }
30481 static int
30482 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30483 {
30484  PyObject *tmp;
30485 #if PY_MAJOR_VERSION >= 3
30486  if (unlikely(value == NULL || !PyUnicode_Check(value)))
30487 #else
30488  if (unlikely(value == NULL || !PyString_Check(value)))
30489 #endif
30490  {
30491  PyErr_SetString(PyExc_TypeError,
30492  "__qualname__ must be set to a string object");
30493  return -1;
30494  }
30495  tmp = op->func_qualname;
30496  Py_INCREF(value);
30497  op->func_qualname = value;
30498  Py_XDECREF(tmp);
30499  return 0;
30500 }
30501 static PyObject *
30502 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
30503 {
30504  PyObject *self;
30505  self = m->func_closure;
30506  if (self == NULL)
30507  self = Py_None;
30508  Py_INCREF(self);
30509  return self;
30510 }
30511 static PyObject *
30512 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30513 {
30514  if (unlikely(op->func_dict == NULL)) {
30515  op->func_dict = PyDict_New();
30516  if (unlikely(op->func_dict == NULL))
30517  return NULL;
30518  }
30519  Py_INCREF(op->func_dict);
30520  return op->func_dict;
30521 }
30522 static int
30523 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
30524 {
30525  PyObject *tmp;
30526  if (unlikely(value == NULL)) {
30527  PyErr_SetString(PyExc_TypeError,
30528  "function's dictionary may not be deleted");
30529  return -1;
30530  }
30531  if (unlikely(!PyDict_Check(value))) {
30532  PyErr_SetString(PyExc_TypeError,
30533  "setting function's dictionary to a non-dict");
30534  return -1;
30535  }
30536  tmp = op->func_dict;
30537  Py_INCREF(value);
30538  op->func_dict = value;
30539  Py_XDECREF(tmp);
30540  return 0;
30541 }
30542 static PyObject *
30543 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30544 {
30545  Py_INCREF(op->func_globals);
30546  return op->func_globals;
30547 }
30548 static PyObject *
30549 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30550 {
30551  Py_INCREF(Py_None);
30552  return Py_None;
30553 }
30554 static PyObject *
30555 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
30556 {
30557  PyObject* result = (op->func_code) ? op->func_code : Py_None;
30558  Py_INCREF(result);
30559  return result;
30560 }
30561 static int
30562 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
30563  int result = 0;
30564  PyObject *res = op->defaults_getter((PyObject *) op);
30565  if (unlikely(!res))
30566  return -1;
30567  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30568  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
30569  Py_INCREF(op->defaults_tuple);
30570  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
30571  Py_INCREF(op->defaults_kwdict);
30572  #else
30573  op->defaults_tuple = PySequence_ITEM(res, 0);
30574  if (unlikely(!op->defaults_tuple)) result = -1;
30575  else {
30576  op->defaults_kwdict = PySequence_ITEM(res, 1);
30577  if (unlikely(!op->defaults_kwdict)) result = -1;
30578  }
30579  #endif
30580  Py_DECREF(res);
30581  return result;
30582 }
30583 static int
30584 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
30585  PyObject* tmp;
30586  if (!value) {
30587  value = Py_None;
30588  } else if (value != Py_None && !PyTuple_Check(value)) {
30589  PyErr_SetString(PyExc_TypeError,
30590  "__defaults__ must be set to a tuple object");
30591  return -1;
30592  }
30593  Py_INCREF(value);
30594  tmp = op->defaults_tuple;
30595  op->defaults_tuple = value;
30596  Py_XDECREF(tmp);
30597  return 0;
30598 }
30599 static PyObject *
30600 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
30601  PyObject* result = op->defaults_tuple;
30602  if (unlikely(!result)) {
30603  if (op->defaults_getter) {
30604  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
30605  result = op->defaults_tuple;
30606  } else {
30607  result = Py_None;
30608  }
30609  }
30610  Py_INCREF(result);
30611  return result;
30612 }
30613 static int
30614 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
30615  PyObject* tmp;
30616  if (!value) {
30617  value = Py_None;
30618  } else if (value != Py_None && !PyDict_Check(value)) {
30619  PyErr_SetString(PyExc_TypeError,
30620  "__kwdefaults__ must be set to a dict object");
30621  return -1;
30622  }
30623  Py_INCREF(value);
30624  tmp = op->defaults_kwdict;
30625  op->defaults_kwdict = value;
30626  Py_XDECREF(tmp);
30627  return 0;
30628 }
30629 static PyObject *
30630 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
30631  PyObject* result = op->defaults_kwdict;
30632  if (unlikely(!result)) {
30633  if (op->defaults_getter) {
30634  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
30635  result = op->defaults_kwdict;
30636  } else {
30637  result = Py_None;
30638  }
30639  }
30640  Py_INCREF(result);
30641  return result;
30642 }
30643 static int
30644 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
30645  PyObject* tmp;
30646  if (!value || value == Py_None) {
30647  value = NULL;
30648  } else if (!PyDict_Check(value)) {
30649  PyErr_SetString(PyExc_TypeError,
30650  "__annotations__ must be set to a dict object");
30651  return -1;
30652  }
30653  Py_XINCREF(value);
30654  tmp = op->func_annotations;
30655  op->func_annotations = value;
30656  Py_XDECREF(tmp);
30657  return 0;
30658 }
30659 static PyObject *
30660 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
30661  PyObject* result = op->func_annotations;
30662  if (unlikely(!result)) {
30663  result = PyDict_New();
30664  if (unlikely(!result)) return NULL;
30665  op->func_annotations = result;
30666  }
30667  Py_INCREF(result);
30668  return result;
30669 }
30670 static PyGetSetDef __pyx_CyFunction_getsets[] = {
30671  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30672  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
30673  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30674  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
30675  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
30676  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
30677  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30678  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
30679  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30680  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
30681  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30682  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
30683  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30684  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
30685  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30686  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
30687  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
30688  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
30689  {0, 0, 0, 0, 0}
30690 };
30691 static PyMemberDef __pyx_CyFunction_members[] = {
30692  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
30693  {0, 0, 0, 0, 0}
30694 };
30695 static PyObject *
30696 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
30697 {
30698 #if PY_MAJOR_VERSION >= 3
30699  Py_INCREF(m->func_qualname);
30700  return m->func_qualname;
30701 #else
30702  return PyString_FromString(m->func.m_ml->ml_name);
30703 #endif
30704 }
30705 static PyMethodDef __pyx_CyFunction_methods[] = {
30706  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
30707  {0, 0, 0, 0}
30708 };
30709 #if PY_VERSION_HEX < 0x030500A0
30710 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
30711 #else
30712 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
30713 #endif
30714 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
30715  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
30716  if (unlikely(op == NULL))
30717  return NULL;
30718  op->flags = flags;
30719  __Pyx_CyFunction_weakreflist(op) = NULL;
30720  op->func.m_ml = ml;
30721  op->func.m_self = (PyObject *) op;
30722  Py_XINCREF(closure);
30723  op->func_closure = closure;
30724  Py_XINCREF(module);
30725  op->func.m_module = module;
30726  op->func_dict = NULL;
30727  op->func_name = NULL;
30728  Py_INCREF(qualname);
30729  op->func_qualname = qualname;
30730  op->func_doc = NULL;
30731  op->func_classobj = NULL;
30732  op->func_globals = globals;
30733  Py_INCREF(op->func_globals);
30734  Py_XINCREF(code);
30735  op->func_code = code;
30736  op->defaults_pyobjects = 0;
30737  op->defaults_size = 0;
30738  op->defaults = NULL;
30739  op->defaults_tuple = NULL;
30740  op->defaults_kwdict = NULL;
30741  op->defaults_getter = NULL;
30742  op->func_annotations = NULL;
30743  return (PyObject *) op;
30744 }
30745 static int
30746 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
30747 {
30748  Py_CLEAR(m->func_closure);
30749  Py_CLEAR(m->func.m_module);
30750  Py_CLEAR(m->func_dict);
30751  Py_CLEAR(m->func_name);
30752  Py_CLEAR(m->func_qualname);
30753  Py_CLEAR(m->func_doc);
30754  Py_CLEAR(m->func_globals);
30755  Py_CLEAR(m->func_code);
30756  Py_CLEAR(m->func_classobj);
30757  Py_CLEAR(m->defaults_tuple);
30758  Py_CLEAR(m->defaults_kwdict);
30759  Py_CLEAR(m->func_annotations);
30760  if (m->defaults) {
30761  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
30762  int i;
30763  for (i = 0; i < m->defaults_pyobjects; i++)
30764  Py_XDECREF(pydefaults[i]);
30765  PyObject_Free(m->defaults);
30766  m->defaults = NULL;
30767  }
30768  return 0;
30769 }
30770 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
30771 {
30772  if (__Pyx_CyFunction_weakreflist(m) != NULL)
30773  PyObject_ClearWeakRefs((PyObject *) m);
30774  __Pyx_CyFunction_clear(m);
30775  PyObject_GC_Del(m);
30776 }
30777 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
30778 {
30779  PyObject_GC_UnTrack(m);
30780  __Pyx__CyFunction_dealloc(m);
30781 }
30782 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
30783 {
30784  Py_VISIT(m->func_closure);
30785  Py_VISIT(m->func.m_module);
30786  Py_VISIT(m->func_dict);
30787  Py_VISIT(m->func_name);
30788  Py_VISIT(m->func_qualname);
30789  Py_VISIT(m->func_doc);
30790  Py_VISIT(m->func_globals);
30791  Py_VISIT(m->func_code);
30792  Py_VISIT(m->func_classobj);
30793  Py_VISIT(m->defaults_tuple);
30794  Py_VISIT(m->defaults_kwdict);
30795  if (m->defaults) {
30796  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
30797  int i;
30798  for (i = 0; i < m->defaults_pyobjects; i++)
30799  Py_VISIT(pydefaults[i]);
30800  }
30801  return 0;
30802 }
30803 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
30804 {
30805 #if PY_MAJOR_VERSION < 3
30806  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30807  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
30808  Py_INCREF(func);
30809  return func;
30810  }
30811  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
30812  if (type == NULL)
30813  type = (PyObject *)(Py_TYPE(obj));
30814  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
30815  }
30816  if (obj == Py_None)
30817  obj = NULL;
30818 #endif
30819  return __Pyx_PyMethod_New(func, obj, type);
30820 }
30821 static PyObject*
30822 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
30823 {
30824 #if PY_MAJOR_VERSION >= 3
30825  return PyUnicode_FromFormat("<cyfunction %U at %p>",
30826  op->func_qualname, (void *)op);
30827 #else
30828  return PyString_FromFormat("<cyfunction %s at %p>",
30829  PyString_AsString(op->func_qualname), (void *)op);
30830 #endif
30831 }
30832 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
30833  PyCFunctionObject* f = (PyCFunctionObject*)func;
30834  PyCFunction meth = f->m_ml->ml_meth;
30835  Py_ssize_t size;
30836  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
30837  case METH_VARARGS:
30838  if (likely(kw == NULL || PyDict_Size(kw) == 0))
30839  return (*meth)(self, arg);
30840  break;
30841  case METH_VARARGS | METH_KEYWORDS:
30842  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
30843  case METH_NOARGS:
30844  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
30845  size = PyTuple_GET_SIZE(arg);
30846  if (likely(size == 0))
30847  return (*meth)(self, NULL);
30848  PyErr_Format(PyExc_TypeError,
30849  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
30850  f->m_ml->ml_name, size);
30851  return NULL;
30852  }
30853  break;
30854  case METH_O:
30855  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
30856  size = PyTuple_GET_SIZE(arg);
30857  if (likely(size == 1)) {
30858  PyObject *result, *arg0;
30859  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30860  arg0 = PyTuple_GET_ITEM(arg, 0);
30861  #else
30862  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
30863  #endif
30864  result = (*meth)(self, arg0);
30865  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
30866  Py_DECREF(arg0);
30867  #endif
30868  return result;
30869  }
30870  PyErr_Format(PyExc_TypeError,
30871  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
30872  f->m_ml->ml_name, size);
30873  return NULL;
30874  }
30875  break;
30876  default:
30877  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
30878  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
30879  "longer supported!");
30880  return NULL;
30881  }
30882  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
30883  f->m_ml->ml_name);
30884  return NULL;
30885 }
30886 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
30887  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
30888 }
30889 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
30890  PyObject *result;
30891  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
30892  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
30893  Py_ssize_t argc;
30894  PyObject *new_args;
30895  PyObject *self;
30896  argc = PyTuple_GET_SIZE(args);
30897  new_args = PyTuple_GetSlice(args, 1, argc);
30898  if (unlikely(!new_args))
30899  return NULL;
30900  self = PyTuple_GetItem(args, 0);
30901  if (unlikely(!self)) {
30902  Py_DECREF(new_args);
30903  return NULL;
30904  }
30905  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
30906  Py_DECREF(new_args);
30907  } else {
30908  result = __Pyx_CyFunction_Call(func, args, kw);
30909  }
30910  return result;
30911 }
30912 static PyTypeObject __pyx_CyFunctionType_type = {
30913  PyVarObject_HEAD_INIT(0, 0)
30914  "cython_function_or_method",
30915  sizeof(__pyx_CyFunctionObject),
30916  0,
30917  (destructor) __Pyx_CyFunction_dealloc,
30918  0,
30919  0,
30920  0,
30921 #if PY_MAJOR_VERSION < 3
30922  0,
30923 #else
30924  0,
30925 #endif
30926  (reprfunc) __Pyx_CyFunction_repr,
30927  0,
30928  0,
30929  0,
30930  0,
30931  __Pyx_CyFunction_CallAsMethod,
30932  0,
30933  0,
30934  0,
30935  0,
30936  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
30937  0,
30938  (traverseproc) __Pyx_CyFunction_traverse,
30939  (inquiry) __Pyx_CyFunction_clear,
30940  0,
30941 #if PY_VERSION_HEX < 0x030500A0
30942  offsetof(__pyx_CyFunctionObject, func_weakreflist),
30943 #else
30944  offsetof(PyCFunctionObject, m_weakreflist),
30945 #endif
30946  0,
30947  0,
30948  __pyx_CyFunction_methods,
30949  __pyx_CyFunction_members,
30950  __pyx_CyFunction_getsets,
30951  0,
30952  0,
30953  __Pyx_CyFunction_descr_get,
30954  0,
30955  offsetof(__pyx_CyFunctionObject, func_dict),
30956  0,
30957  0,
30958  0,
30959  0,
30960  0,
30961  0,
30962  0,
30963  0,
30964  0,
30965  0,
30966  0,
30967  0,
30968 #if PY_VERSION_HEX >= 0x030400a1
30969  0,
30970 #endif
30971 #if PY_VERSION_HEX >= 0x030800b1
30972  0,
30973 #endif
30974 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30975  0,
30976 #endif
30977 };
30978 static int __pyx_CyFunction_init(void) {
30979  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
30980  if (unlikely(__pyx_CyFunctionType == NULL)) {
30981  return -1;
30982  }
30983  return 0;
30984 }
30985 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
30986  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30987  m->defaults = PyObject_Malloc(size);
30988  if (unlikely(!m->defaults))
30989  return PyErr_NoMemory();
30990  memset(m->defaults, 0, size);
30991  m->defaults_pyobjects = pyobjects;
30992  m->defaults_size = size;
30993  return m->defaults;
30994 }
30995 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
30996  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30997  m->defaults_tuple = tuple;
30998  Py_INCREF(tuple);
30999 }
31000 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
31001  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31002  m->defaults_kwdict = dict;
31003  Py_INCREF(dict);
31004 }
31005 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
31006  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
31007  m->func_annotations = dict;
31008  Py_INCREF(dict);
31009 }
31010 
31011 /* CythonFunction */
31012 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
31013  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
31014  PyObject *op = __Pyx_CyFunction_Init(
31015  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
31016  ml, flags, qualname, closure, module, globals, code
31017  );
31018  if (likely(op)) {
31019  PyObject_GC_Track(op);
31020  }
31021  return op;
31022 }
31023 
31024 /* CLineInTraceback */
31025 #ifndef CYTHON_CLINE_IN_TRACEBACK
31026 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
31027  PyObject *use_cline;
31028  PyObject *ptype, *pvalue, *ptraceback;
31029 #if CYTHON_COMPILING_IN_CPYTHON
31030  PyObject **cython_runtime_dict;
31031 #endif
31032  if (unlikely(!__pyx_cython_runtime)) {
31033  return c_line;
31034  }
31035  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
31036 #if CYTHON_COMPILING_IN_CPYTHON
31037  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
31038  if (likely(cython_runtime_dict)) {
31039  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
31040  use_cline, *cython_runtime_dict,
31041  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
31042  } else
31043 #endif
31044  {
31045  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
31046  if (use_cline_obj) {
31047  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
31048  Py_DECREF(use_cline_obj);
31049  } else {
31050  PyErr_Clear();
31051  use_cline = NULL;
31052  }
31053  }
31054  if (!use_cline) {
31055  c_line = 0;
31056  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
31057  }
31058  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
31059  c_line = 0;
31060  }
31061  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
31062  return c_line;
31063 }
31064 #endif
31065 
31066 /* CodeObjectCache */
31067 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
31068  int start = 0, mid = 0, end = count - 1;
31069  if (end >= 0 && code_line > entries[end].code_line) {
31070  return count;
31071  }
31072  while (start < end) {
31073  mid = start + (end - start) / 2;
31074  if (code_line < entries[mid].code_line) {
31075  end = mid;
31076  } else if (code_line > entries[mid].code_line) {
31077  start = mid + 1;
31078  } else {
31079  return mid;
31080  }
31081  }
31082  if (code_line <= entries[mid].code_line) {
31083  return mid;
31084  } else {
31085  return mid + 1;
31086  }
31087 }
31088 static PyCodeObject *__pyx_find_code_object(int code_line) {
31089  PyCodeObject* code_object;
31090  int pos;
31091  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
31092  return NULL;
31093  }
31094  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31095  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
31096  return NULL;
31097  }
31098  code_object = __pyx_code_cache.entries[pos].code_object;
31099  Py_INCREF(code_object);
31100  return code_object;
31101 }
31102 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
31103  int pos, i;
31104  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
31105  if (unlikely(!code_line)) {
31106  return;
31107  }
31108  if (unlikely(!entries)) {
31109  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
31110  if (likely(entries)) {
31111  __pyx_code_cache.entries = entries;
31112  __pyx_code_cache.max_count = 64;
31113  __pyx_code_cache.count = 1;
31114  entries[0].code_line = code_line;
31115  entries[0].code_object = code_object;
31116  Py_INCREF(code_object);
31117  }
31118  return;
31119  }
31120  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
31121  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
31122  PyCodeObject* tmp = entries[pos].code_object;
31123  entries[pos].code_object = code_object;
31124  Py_DECREF(tmp);
31125  return;
31126  }
31127  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
31128  int new_max = __pyx_code_cache.max_count + 64;
31129  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
31130  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
31131  if (unlikely(!entries)) {
31132  return;
31133  }
31134  __pyx_code_cache.entries = entries;
31135  __pyx_code_cache.max_count = new_max;
31136  }
31137  for (i=__pyx_code_cache.count; i>pos; i--) {
31138  entries[i] = entries[i-1];
31139  }
31140  entries[pos].code_line = code_line;
31141  entries[pos].code_object = code_object;
31142  __pyx_code_cache.count++;
31143  Py_INCREF(code_object);
31144 }
31145 
31146 /* AddTraceback */
31147 #include "compile.h"
31148 #include "frameobject.h"
31149 #include "traceback.h"
31150 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
31151  const char *funcname, int c_line,
31152  int py_line, const char *filename) {
31153  PyCodeObject *py_code = 0;
31154  PyObject *py_srcfile = 0;
31155  PyObject *py_funcname = 0;
31156  #if PY_MAJOR_VERSION < 3
31157  py_srcfile = PyString_FromString(filename);
31158  #else
31159  py_srcfile = PyUnicode_FromString(filename);
31160  #endif
31161  if (!py_srcfile) goto bad;
31162  if (c_line) {
31163  #if PY_MAJOR_VERSION < 3
31164  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31165  #else
31166  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
31167  #endif
31168  }
31169  else {
31170  #if PY_MAJOR_VERSION < 3
31171  py_funcname = PyString_FromString(funcname);
31172  #else
31173  py_funcname = PyUnicode_FromString(funcname);
31174  #endif
31175  }
31176  if (!py_funcname) goto bad;
31177  py_code = __Pyx_PyCode_New(
31178  0,
31179  0,
31180  0,
31181  0,
31182  0,
31183  __pyx_empty_bytes, /*PyObject *code,*/
31184  __pyx_empty_tuple, /*PyObject *consts,*/
31185  __pyx_empty_tuple, /*PyObject *names,*/
31186  __pyx_empty_tuple, /*PyObject *varnames,*/
31187  __pyx_empty_tuple, /*PyObject *freevars,*/
31188  __pyx_empty_tuple, /*PyObject *cellvars,*/
31189  py_srcfile, /*PyObject *filename,*/
31190  py_funcname, /*PyObject *name,*/
31191  py_line,
31192  __pyx_empty_bytes /*PyObject *lnotab*/
31193  );
31194  Py_DECREF(py_srcfile);
31195  Py_DECREF(py_funcname);
31196  return py_code;
31197 bad:
31198  Py_XDECREF(py_srcfile);
31199  Py_XDECREF(py_funcname);
31200  return NULL;
31201 }
31202 static void __Pyx_AddTraceback(const char *funcname, int c_line,
31203  int py_line, const char *filename) {
31204  PyCodeObject *py_code = 0;
31205  PyFrameObject *py_frame = 0;
31206  PyThreadState *tstate = __Pyx_PyThreadState_Current;
31207  if (c_line) {
31208  c_line = __Pyx_CLineForTraceback(tstate, c_line);
31209  }
31210  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
31211  if (!py_code) {
31212  py_code = __Pyx_CreateCodeObjectForTraceback(
31213  funcname, c_line, py_line, filename);
31214  if (!py_code) goto bad;
31215  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
31216  }
31217  py_frame = PyFrame_New(
31218  tstate, /*PyThreadState *tstate,*/
31219  py_code, /*PyCodeObject *code,*/
31220  __pyx_d, /*PyObject *globals,*/
31221  0 /*PyObject *locals*/
31222  );
31223  if (!py_frame) goto bad;
31224  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
31225  PyTraceBack_Here(py_frame);
31226 bad:
31227  Py_XDECREF(py_code);
31228  Py_XDECREF(py_frame);
31229 }
31230 
31231 #if PY_MAJOR_VERSION < 3
31232 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
31233  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
31234  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
31235  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
31236  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
31237  return -1;
31238 }
31239 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
31240  PyObject *obj = view->obj;
31241  if (!obj) return;
31242  if (PyObject_CheckBuffer(obj)) {
31243  PyBuffer_Release(view);
31244  return;
31245  }
31246  if ((0)) {}
31247  view->obj = NULL;
31248  Py_DECREF(obj);
31249 }
31250 #endif
31251 
31252 
31253 /* MemviewSliceIsContig */
31254 static int
31255 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
31256 {
31257  int i, index, step, start;
31258  Py_ssize_t itemsize = mvs.memview->view.itemsize;
31259  if (order == 'F') {
31260  step = 1;
31261  start = 0;
31262  } else {
31263  step = -1;
31264  start = ndim - 1;
31265  }
31266  for (i = 0; i < ndim; i++) {
31267  index = start + step * i;
31268  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
31269  return 0;
31270  itemsize *= mvs.shape[index];
31271  }
31272  return 1;
31273 }
31274 
31275 /* OverlappingSlices */
31276 static void
31277 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
31278  void **out_start, void **out_end,
31279  int ndim, size_t itemsize)
31280 {
31281  char *start, *end;
31282  int i;
31283  start = end = slice->data;
31284  for (i = 0; i < ndim; i++) {
31285  Py_ssize_t stride = slice->strides[i];
31286  Py_ssize_t extent = slice->shape[i];
31287  if (extent == 0) {
31288  *out_start = *out_end = start;
31289  return;
31290  } else {
31291  if (stride > 0)
31292  end += stride * (extent - 1);
31293  else
31294  start += stride * (extent - 1);
31295  }
31296  }
31297  *out_start = start;
31298  *out_end = end + itemsize;
31299 }
31300 static int
31301 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
31302  __Pyx_memviewslice *slice2,
31303  int ndim, size_t itemsize)
31304 {
31305  void *start1, *end1, *start2, *end2;
31306  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
31307  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
31308  return (start1 < end2) && (start2 < end1);
31309 }
31310 
31311 /* Capsule */
31312 static CYTHON_INLINE PyObject *
31313 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
31314 {
31315  PyObject *cobj;
31316 #if PY_VERSION_HEX >= 0x02070000
31317  cobj = PyCapsule_New(p, sig, NULL);
31318 #else
31319  cobj = PyCObject_FromVoidPtr(p, NULL);
31320 #endif
31321  return cobj;
31322 }
31323 
31324 /* CIntFromPyVerify */
31325 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
31326  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
31327 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
31328  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
31329 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
31330  {\
31331  func_type value = func_value;\
31332  if (sizeof(target_type) < sizeof(func_type)) {\
31333  if (unlikely(value != (func_type) (target_type) value)) {\
31334  func_type zero = 0;\
31335  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
31336  return (target_type) -1;\
31337  if (is_unsigned && unlikely(value < zero))\
31338  goto raise_neg_overflow;\
31339  else\
31340  goto raise_overflow;\
31341  }\
31342  }\
31343  return (target_type) value;\
31344  }
31345 
31346 /* IsLittleEndian */
31347 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
31348 {
31349  union {
31350  uint32_t u32;
31351  uint8_t u8[4];
31352  } S;
31353  S.u32 = 0x01020304;
31354  return S.u8[0] == 4;
31355 }
31356 
31357 /* BufferFormatCheck */
31358 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
31359  __Pyx_BufFmt_StackElem* stack,
31360  __Pyx_TypeInfo* type) {
31361  stack[0].field = &ctx->root;
31362  stack[0].parent_offset = 0;
31363  ctx->root.type = type;
31364  ctx->root.name = "buffer dtype";
31365  ctx->root.offset = 0;
31366  ctx->head = stack;
31367  ctx->head->field = &ctx->root;
31368  ctx->fmt_offset = 0;
31369  ctx->head->parent_offset = 0;
31370  ctx->new_packmode = '@';
31371  ctx->enc_packmode = '@';
31372  ctx->new_count = 1;
31373  ctx->enc_count = 0;
31374  ctx->enc_type = 0;
31375  ctx->is_complex = 0;
31376  ctx->is_valid_array = 0;
31377  ctx->struct_alignment = 0;
31378  while (type->typegroup == 'S') {
31379  ++ctx->head;
31380  ctx->head->field = type->fields;
31381  ctx->head->parent_offset = 0;
31382  type = type->fields->type;
31383  }
31384 }
31385 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
31386  int count;
31387  const char* t = *ts;
31388  if (*t < '0' || *t > '9') {
31389  return -1;
31390  } else {
31391  count = *t++ - '0';
31392  while (*t >= '0' && *t <= '9') {
31393  count *= 10;
31394  count += *t++ - '0';
31395  }
31396  }
31397  *ts = t;
31398  return count;
31399 }
31400 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
31401  int number = __Pyx_BufFmt_ParseNumber(ts);
31402  if (number == -1)
31403  PyErr_Format(PyExc_ValueError,\
31404  "Does not understand character buffer dtype format string ('%c')", **ts);
31405  return number;
31406 }
31407 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
31408  PyErr_Format(PyExc_ValueError,
31409  "Unexpected format string character: '%c'", ch);
31410 }
31411 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
31412  switch (ch) {
31413  case '?': return "'bool'";
31414  case 'c': return "'char'";
31415  case 'b': return "'signed char'";
31416  case 'B': return "'unsigned char'";
31417  case 'h': return "'short'";
31418  case 'H': return "'unsigned short'";
31419  case 'i': return "'int'";
31420  case 'I': return "'unsigned int'";
31421  case 'l': return "'long'";
31422  case 'L': return "'unsigned long'";
31423  case 'q': return "'long long'";
31424  case 'Q': return "'unsigned long long'";
31425  case 'f': return (is_complex ? "'complex float'" : "'float'");
31426  case 'd': return (is_complex ? "'complex double'" : "'double'");
31427  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
31428  case 'T': return "a struct";
31429  case 'O': return "Python object";
31430  case 'P': return "a pointer";
31431  case 's': case 'p': return "a string";
31432  case 0: return "end";
31433  default: return "unparseable format string";
31434  }
31435 }
31436 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
31437  switch (ch) {
31438  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31439  case 'h': case 'H': return 2;
31440  case 'i': case 'I': case 'l': case 'L': return 4;
31441  case 'q': case 'Q': return 8;
31442  case 'f': return (is_complex ? 8 : 4);
31443  case 'd': return (is_complex ? 16 : 8);
31444  case 'g': {
31445  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
31446  return 0;
31447  }
31448  case 'O': case 'P': return sizeof(void*);
31449  default:
31450  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31451  return 0;
31452  }
31453 }
31454 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
31455  switch (ch) {
31456  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31457  case 'h': case 'H': return sizeof(short);
31458  case 'i': case 'I': return sizeof(int);
31459  case 'l': case 'L': return sizeof(long);
31460  #ifdef HAVE_LONG_LONG
31461  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
31462  #endif
31463  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
31464  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
31465  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
31466  case 'O': case 'P': return sizeof(void*);
31467  default: {
31468  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31469  return 0;
31470  }
31471  }
31472 }
31473 typedef struct { char c; short x; } __Pyx_st_short;
31474 typedef struct { char c; int x; } __Pyx_st_int;
31475 typedef struct { char c; long x; } __Pyx_st_long;
31476 typedef struct { char c; float x; } __Pyx_st_float;
31477 typedef struct { char c; double x; } __Pyx_st_double;
31478 typedef struct { char c; long double x; } __Pyx_st_longdouble;
31479 typedef struct { char c; void *x; } __Pyx_st_void_p;
31480 #ifdef HAVE_LONG_LONG
31481 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
31482 #endif
31483 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
31484  switch (ch) {
31485  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31486  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
31487  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
31488  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
31489 #ifdef HAVE_LONG_LONG
31490  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
31491 #endif
31492  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
31493  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
31494  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
31495  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
31496  default:
31497  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31498  return 0;
31499  }
31500 }
31501 /* These are for computing the padding at the end of the struct to align
31502  on the first member of the struct. This will probably the same as above,
31503  but we don't have any guarantees.
31504  */
31505 typedef struct { short x; char c; } __Pyx_pad_short;
31506 typedef struct { int x; char c; } __Pyx_pad_int;
31507 typedef struct { long x; char c; } __Pyx_pad_long;
31508 typedef struct { float x; char c; } __Pyx_pad_float;
31509 typedef struct { double x; char c; } __Pyx_pad_double;
31510 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
31511 typedef struct { void *x; char c; } __Pyx_pad_void_p;
31512 #ifdef HAVE_LONG_LONG
31513 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
31514 #endif
31515 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
31516  switch (ch) {
31517  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31518  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
31519  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
31520  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
31521 #ifdef HAVE_LONG_LONG
31522  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
31523 #endif
31524  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
31525  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
31526  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
31527  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
31528  default:
31529  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31530  return 0;
31531  }
31532 }
31533 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
31534  switch (ch) {
31535  case 'c':
31536  return 'H';
31537  case 'b': case 'h': case 'i':
31538  case 'l': case 'q': case 's': case 'p':
31539  return 'I';
31540  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
31541  return 'U';
31542  case 'f': case 'd': case 'g':
31543  return (is_complex ? 'C' : 'R');
31544  case 'O':
31545  return 'O';
31546  case 'P':
31547  return 'P';
31548  default: {
31549  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31550  return 0;
31551  }
31552  }
31553 }
31554 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
31555  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
31556  const char* expected;
31557  const char* quote;
31558  if (ctx->head == NULL) {
31559  expected = "end";
31560  quote = "";
31561  } else {
31562  expected = ctx->head->field->type->name;
31563  quote = "'";
31564  }
31565  PyErr_Format(PyExc_ValueError,
31566  "Buffer dtype mismatch, expected %s%s%s but got %s",
31567  quote, expected, quote,
31568  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
31569  } else {
31570  __Pyx_StructField* field = ctx->head->field;
31571  __Pyx_StructField* parent = (ctx->head - 1)->field;
31572  PyErr_Format(PyExc_ValueError,
31573  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
31574  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
31575  parent->type->name, field->name);
31576  }
31577 }
31578 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
31579  char group;
31580  size_t size, offset, arraysize = 1;
31581  if (ctx->enc_type == 0) return 0;
31582  if (ctx->head->field->type->arraysize[0]) {
31583  int i, ndim = 0;
31584  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
31585  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
31586  ndim = 1;
31587  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
31588  PyErr_Format(PyExc_ValueError,
31589  "Expected a dimension of size %zu, got %zu",
31590  ctx->head->field->type->arraysize[0], ctx->enc_count);
31591  return -1;
31592  }
31593  }
31594  if (!ctx->is_valid_array) {
31595  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
31596  ctx->head->field->type->ndim, ndim);
31597  return -1;
31598  }
31599  for (i = 0; i < ctx->head->field->type->ndim; i++) {
31600  arraysize *= ctx->head->field->type->arraysize[i];
31601  }
31602  ctx->is_valid_array = 0;
31603  ctx->enc_count = 1;
31604  }
31605  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
31606  do {
31607  __Pyx_StructField* field = ctx->head->field;
31608  __Pyx_TypeInfo* type = field->type;
31609  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
31610  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
31611  } else {
31612  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
31613  }
31614  if (ctx->enc_packmode == '@') {
31615  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
31616  size_t align_mod_offset;
31617  if (align_at == 0) return -1;
31618  align_mod_offset = ctx->fmt_offset % align_at;
31619  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
31620  if (ctx->struct_alignment == 0)
31621  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
31622  ctx->is_complex);
31623  }
31624  if (type->size != size || type->typegroup != group) {
31625  if (type->typegroup == 'C' && type->fields != NULL) {
31626  size_t parent_offset = ctx->head->parent_offset + field->offset;
31627  ++ctx->head;
31628  ctx->head->field = type->fields;
31629  ctx->head->parent_offset = parent_offset;
31630  continue;
31631  }
31632  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
31633  } else {
31634  __Pyx_BufFmt_RaiseExpected(ctx);
31635  return -1;
31636  }
31637  }
31638  offset = ctx->head->parent_offset + field->offset;
31639  if (ctx->fmt_offset != offset) {
31640  PyErr_Format(PyExc_ValueError,
31641  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
31642  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
31643  return -1;
31644  }
31645  ctx->fmt_offset += size;
31646  if (arraysize)
31647  ctx->fmt_offset += (arraysize - 1) * size;
31648  --ctx->enc_count;
31649  while (1) {
31650  if (field == &ctx->root) {
31651  ctx->head = NULL;
31652  if (ctx->enc_count != 0) {
31653  __Pyx_BufFmt_RaiseExpected(ctx);
31654  return -1;
31655  }
31656  break;
31657  }
31658  ctx->head->field = ++field;
31659  if (field->type == NULL) {
31660  --ctx->head;
31661  field = ctx->head->field;
31662  continue;
31663  } else if (field->type->typegroup == 'S') {
31664  size_t parent_offset = ctx->head->parent_offset + field->offset;
31665  if (field->type->fields->type == NULL) continue;
31666  field = field->type->fields;
31667  ++ctx->head;
31668  ctx->head->field = field;
31669  ctx->head->parent_offset = parent_offset;
31670  break;
31671  } else {
31672  break;
31673  }
31674  }
31675  } while (ctx->enc_count);
31676  ctx->enc_type = 0;
31677  ctx->is_complex = 0;
31678  return 0;
31679 }
31680 static PyObject *
31681 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
31682 {
31683  const char *ts = *tsp;
31684  int i = 0, number, ndim;
31685  ++ts;
31686  if (ctx->new_count != 1) {
31687  PyErr_SetString(PyExc_ValueError,
31688  "Cannot handle repeated arrays in format string");
31689  return NULL;
31690  }
31691  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31692  ndim = ctx->head->field->type->ndim;
31693  while (*ts && *ts != ')') {
31694  switch (*ts) {
31695  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
31696  default: break;
31697  }
31698  number = __Pyx_BufFmt_ExpectNumber(&ts);
31699  if (number == -1) return NULL;
31700  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
31701  return PyErr_Format(PyExc_ValueError,
31702  "Expected a dimension of size %zu, got %d",
31703  ctx->head->field->type->arraysize[i], number);
31704  if (*ts != ',' && *ts != ')')
31705  return PyErr_Format(PyExc_ValueError,
31706  "Expected a comma in format string, got '%c'", *ts);
31707  if (*ts == ',') ts++;
31708  i++;
31709  }
31710  if (i != ndim)
31711  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
31712  ctx->head->field->type->ndim, i);
31713  if (!*ts) {
31714  PyErr_SetString(PyExc_ValueError,
31715  "Unexpected end of format string, expected ')'");
31716  return NULL;
31717  }
31718  ctx->is_valid_array = 1;
31719  ctx->new_count = 1;
31720  *tsp = ++ts;
31721  return Py_None;
31722 }
31723 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
31724  int got_Z = 0;
31725  while (1) {
31726  switch(*ts) {
31727  case 0:
31728  if (ctx->enc_type != 0 && ctx->head == NULL) {
31729  __Pyx_BufFmt_RaiseExpected(ctx);
31730  return NULL;
31731  }
31732  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31733  if (ctx->head != NULL) {
31734  __Pyx_BufFmt_RaiseExpected(ctx);
31735  return NULL;
31736  }
31737  return ts;
31738  case ' ':
31739  case '\r':
31740  case '\n':
31741  ++ts;
31742  break;
31743  case '<':
31744  if (!__Pyx_Is_Little_Endian()) {
31745  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
31746  return NULL;
31747  }
31748  ctx->new_packmode = '=';
31749  ++ts;
31750  break;
31751  case '>':
31752  case '!':
31753  if (__Pyx_Is_Little_Endian()) {
31754  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
31755  return NULL;
31756  }
31757  ctx->new_packmode = '=';
31758  ++ts;
31759  break;
31760  case '=':
31761  case '@':
31762  case '^':
31763  ctx->new_packmode = *ts++;
31764  break;
31765  case 'T':
31766  {
31767  const char* ts_after_sub;
31768  size_t i, struct_count = ctx->new_count;
31769  size_t struct_alignment = ctx->struct_alignment;
31770  ctx->new_count = 1;
31771  ++ts;
31772  if (*ts != '{') {
31773  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
31774  return NULL;
31775  }
31776  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31777  ctx->enc_type = 0;
31778  ctx->enc_count = 0;
31779  ctx->struct_alignment = 0;
31780  ++ts;
31781  ts_after_sub = ts;
31782  for (i = 0; i != struct_count; ++i) {
31783  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
31784  if (!ts_after_sub) return NULL;
31785  }
31786  ts = ts_after_sub;
31787  if (struct_alignment) ctx->struct_alignment = struct_alignment;
31788  }
31789  break;
31790  case '}':
31791  {
31792  size_t alignment = ctx->struct_alignment;
31793  ++ts;
31794  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31795  ctx->enc_type = 0;
31796  if (alignment && ctx->fmt_offset % alignment) {
31797  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
31798  }
31799  }
31800  return ts;
31801  case 'x':
31802  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31803  ctx->fmt_offset += ctx->new_count;
31804  ctx->new_count = 1;
31805  ctx->enc_count = 0;
31806  ctx->enc_type = 0;
31807  ctx->enc_packmode = ctx->new_packmode;
31808  ++ts;
31809  break;
31810  case 'Z':
31811  got_Z = 1;
31812  ++ts;
31813  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
31814  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
31815  return NULL;
31816  }
31817  CYTHON_FALLTHROUGH;
31818  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
31819  case 'l': case 'L': case 'q': case 'Q':
31820  case 'f': case 'd': case 'g':
31821  case 'O': case 'p':
31822  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
31823  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
31824  ctx->enc_count += ctx->new_count;
31825  ctx->new_count = 1;
31826  got_Z = 0;
31827  ++ts;
31828  break;
31829  }
31830  CYTHON_FALLTHROUGH;
31831  case 's':
31832  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31833  ctx->enc_count = ctx->new_count;
31834  ctx->enc_packmode = ctx->new_packmode;
31835  ctx->enc_type = *ts;
31836  ctx->is_complex = got_Z;
31837  ++ts;
31838  ctx->new_count = 1;
31839  got_Z = 0;
31840  break;
31841  case ':':
31842  ++ts;
31843  while(*ts != ':') ++ts;
31844  ++ts;
31845  break;
31846  case '(':
31847  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
31848  break;
31849  default:
31850  {
31851  int number = __Pyx_BufFmt_ExpectNumber(&ts);
31852  if (number == -1) return NULL;
31853  ctx->new_count = (size_t)number;
31854  }
31855  }
31856  }
31857 }
31858 
31859 /* TypeInfoCompare */
31860  static int
31861 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
31862 {
31863  int i;
31864  if (!a || !b)
31865  return 0;
31866  if (a == b)
31867  return 1;
31868  if (a->size != b->size || a->typegroup != b->typegroup ||
31869  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
31870  if (a->typegroup == 'H' || b->typegroup == 'H') {
31871  return a->size == b->size;
31872  } else {
31873  return 0;
31874  }
31875  }
31876  if (a->ndim) {
31877  for (i = 0; i < a->ndim; i++)
31878  if (a->arraysize[i] != b->arraysize[i])
31879  return 0;
31880  }
31881  if (a->typegroup == 'S') {
31882  if (a->flags != b->flags)
31883  return 0;
31884  if (a->fields || b->fields) {
31885  if (!(a->fields && b->fields))
31886  return 0;
31887  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
31888  __Pyx_StructField *field_a = a->fields + i;
31889  __Pyx_StructField *field_b = b->fields + i;
31890  if (field_a->offset != field_b->offset ||
31891  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
31892  return 0;
31893  }
31894  return !a->fields[i].type && !b->fields[i].type;
31895  }
31896  }
31897  return 1;
31898 }
31899 
31900 /* MemviewSliceValidateAndInit */
31901  static int
31902 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
31903 {
31904  if (buf->shape[dim] <= 1)
31905  return 1;
31906  if (buf->strides) {
31907  if (spec & __Pyx_MEMVIEW_CONTIG) {
31908  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
31909  if (unlikely(buf->strides[dim] != sizeof(void *))) {
31910  PyErr_Format(PyExc_ValueError,
31911  "Buffer is not indirectly contiguous "
31912  "in dimension %d.", dim);
31913  goto fail;
31914  }
31915  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
31916  PyErr_SetString(PyExc_ValueError,
31917  "Buffer and memoryview are not contiguous "
31918  "in the same dimension.");
31919  goto fail;
31920  }
31921  }
31922  if (spec & __Pyx_MEMVIEW_FOLLOW) {
31923  Py_ssize_t stride = buf->strides[dim];
31924  if (stride < 0)
31925  stride = -stride;
31926  if (unlikely(stride < buf->itemsize)) {
31927  PyErr_SetString(PyExc_ValueError,
31928  "Buffer and memoryview are not contiguous "
31929  "in the same dimension.");
31930  goto fail;
31931  }
31932  }
31933  } else {
31934  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
31935  PyErr_Format(PyExc_ValueError,
31936  "C-contiguous buffer is not contiguous in "
31937  "dimension %d", dim);
31938  goto fail;
31939  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
31940  PyErr_Format(PyExc_ValueError,
31941  "C-contiguous buffer is not indirect in "
31942  "dimension %d", dim);
31943  goto fail;
31944  } else if (unlikely(buf->suboffsets)) {
31945  PyErr_SetString(PyExc_ValueError,
31946  "Buffer exposes suboffsets but no strides");
31947  goto fail;
31948  }
31949  }
31950  return 1;
31951 fail:
31952  return 0;
31953 }
31954 static int
31955 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
31956 {
31957  if (spec & __Pyx_MEMVIEW_DIRECT) {
31958  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
31959  PyErr_Format(PyExc_ValueError,
31960  "Buffer not compatible with direct access "
31961  "in dimension %d.", dim);
31962  goto fail;
31963  }
31964  }
31965  if (spec & __Pyx_MEMVIEW_PTR) {
31966  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
31967  PyErr_Format(PyExc_ValueError,
31968  "Buffer is not indirectly accessible "
31969  "in dimension %d.", dim);
31970  goto fail;
31971  }
31972  }
31973  return 1;
31974 fail:
31975  return 0;
31976 }
31977 static int
31978 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
31979 {
31980  int i;
31981  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
31982  Py_ssize_t stride = 1;
31983  for (i = 0; i < ndim; i++) {
31984  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
31985  PyErr_SetString(PyExc_ValueError,
31986  "Buffer not fortran contiguous.");
31987  goto fail;
31988  }
31989  stride = stride * buf->shape[i];
31990  }
31991  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
31992  Py_ssize_t stride = 1;
31993  for (i = ndim - 1; i >- 1; i--) {
31994  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
31995  PyErr_SetString(PyExc_ValueError,
31996  "Buffer not C contiguous.");
31997  goto fail;
31998  }
31999  stride = stride * buf->shape[i];
32000  }
32001  }
32002  return 1;
32003 fail:
32004  return 0;
32005 }
32006 static int __Pyx_ValidateAndInit_memviewslice(
32007  int *axes_specs,
32008  int c_or_f_flag,
32009  int buf_flags,
32010  int ndim,
32011  __Pyx_TypeInfo *dtype,
32012  __Pyx_BufFmt_StackElem stack[],
32013  __Pyx_memviewslice *memviewslice,
32014  PyObject *original_obj)
32015 {
32016  struct __pyx_memoryview_obj *memview, *new_memview;
32017  __Pyx_RefNannyDeclarations
32018  Py_buffer *buf;
32019  int i, spec = 0, retval = -1;
32020  __Pyx_BufFmt_Context ctx;
32021  int from_memoryview = __pyx_memoryview_check(original_obj);
32022  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
32023  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
32024  original_obj)->typeinfo)) {
32025  memview = (struct __pyx_memoryview_obj *) original_obj;
32026  new_memview = NULL;
32027  } else {
32028  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32029  original_obj, buf_flags, 0, dtype);
32030  new_memview = memview;
32031  if (unlikely(!memview))
32032  goto fail;
32033  }
32034  buf = &memview->view;
32035  if (unlikely(buf->ndim != ndim)) {
32036  PyErr_Format(PyExc_ValueError,
32037  "Buffer has wrong number of dimensions (expected %d, got %d)",
32038  ndim, buf->ndim);
32039  goto fail;
32040  }
32041  if (new_memview) {
32042  __Pyx_BufFmt_Init(&ctx, stack, dtype);
32043  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
32044  }
32045  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
32046  PyErr_Format(PyExc_ValueError,
32047  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
32048  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
32049  buf->itemsize,
32050  (buf->itemsize > 1) ? "s" : "",
32051  dtype->name,
32052  dtype->size,
32053  (dtype->size > 1) ? "s" : "");
32054  goto fail;
32055  }
32056  if (buf->len > 0) {
32057  for (i = 0; i < ndim; i++) {
32058  spec = axes_specs[i];
32059  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
32060  goto fail;
32061  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
32062  goto fail;
32063  }
32064  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
32065  goto fail;
32066  }
32067  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
32068  new_memview != NULL) == -1)) {
32069  goto fail;
32070  }
32071  retval = 0;
32072  goto no_fail;
32073 fail:
32074  Py_XDECREF(new_memview);
32075  retval = -1;
32076 no_fail:
32077  __Pyx_RefNannyFinishContext();
32078  return retval;
32079 }
32080 
32081 /* ObjectToMemviewSlice */
32082  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) {
32083  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32084  __Pyx_BufFmt_StackElem stack[1];
32085  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32086  int retcode;
32087  if (obj == Py_None) {
32088  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32089  return result;
32090  }
32091  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32092  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32093  &__Pyx_TypeInfo_float, stack,
32094  &result, obj);
32095  if (unlikely(retcode == -1))
32096  goto __pyx_fail;
32097  return result;
32098 __pyx_fail:
32099  result.memview = NULL;
32100  result.data = NULL;
32101  return result;
32102 }
32103 
32104 /* ObjectToMemviewSlice */
32105  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj, int writable_flag) {
32106  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32107  __Pyx_BufFmt_StackElem stack[1];
32108  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32109  int retcode;
32110  if (obj == Py_None) {
32111  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32112  return result;
32113  }
32114  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32115  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32116  &__Pyx_TypeInfo_float, stack,
32117  &result, obj);
32118  if (unlikely(retcode == -1))
32119  goto __pyx_fail;
32120  return result;
32121 __pyx_fail:
32122  result.memview = NULL;
32123  result.data = NULL;
32124  return result;
32125 }
32126 
32127 /* ObjectToMemviewSlice */
32128  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
32129  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32130  __Pyx_BufFmt_StackElem stack[1];
32131  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32132  int retcode;
32133  if (obj == Py_None) {
32134  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32135  return result;
32136  }
32137  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32138  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32139  &__Pyx_TypeInfo_double, stack,
32140  &result, obj);
32141  if (unlikely(retcode == -1))
32142  goto __pyx_fail;
32143  return result;
32144 __pyx_fail:
32145  result.memview = NULL;
32146  result.data = NULL;
32147  return result;
32148 }
32149 
32150 /* ObjectToMemviewSlice */
32151  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) {
32152  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32153  __Pyx_BufFmt_StackElem stack[1];
32154  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32155  int retcode;
32156  if (obj == Py_None) {
32157  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32158  return result;
32159  }
32160  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32161  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32162  &__Pyx_TypeInfo_double, stack,
32163  &result, obj);
32164  if (unlikely(retcode == -1))
32165  goto __pyx_fail;
32166  return result;
32167 __pyx_fail:
32168  result.memview = NULL;
32169  result.data = NULL;
32170  return result;
32171 }
32172 
32173 /* ObjectToMemviewSlice */
32174  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj, int writable_flag) {
32175  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32176  __Pyx_BufFmt_StackElem stack[1];
32177  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
32178  int retcode;
32179  if (obj == Py_None) {
32180  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32181  return result;
32182  }
32183  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
32184  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32185  &__Pyx_TypeInfo_long__double, stack,
32186  &result, obj);
32187  if (unlikely(retcode == -1))
32188  goto __pyx_fail;
32189  return result;
32190 __pyx_fail:
32191  result.memview = NULL;
32192  result.data = NULL;
32193  return result;
32194 }
32195 
32196 /* ObjectToMemviewSlice */
32197  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj, int writable_flag) {
32198  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32199  __Pyx_BufFmt_StackElem stack[1];
32200  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
32201  int retcode;
32202  if (obj == Py_None) {
32203  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32204  return result;
32205  }
32206  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
32207  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
32208  &__Pyx_TypeInfo_long__double, stack,
32209  &result, obj);
32210  if (unlikely(retcode == -1))
32211  goto __pyx_fail;
32212  return result;
32213 __pyx_fail:
32214  result.memview = NULL;
32215  result.data = NULL;
32216  return result;
32217 }
32218 
32219 /* ObjectToMemviewSlice */
32220  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
32221  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32222  __Pyx_BufFmt_StackElem stack[1];
32223  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32224  int retcode;
32225  if (obj == Py_None) {
32226  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32227  return result;
32228  }
32229  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32230  PyBUF_RECORDS_RO | writable_flag, 1,
32231  &__Pyx_TypeInfo_float, stack,
32232  &result, obj);
32233  if (unlikely(retcode == -1))
32234  goto __pyx_fail;
32235  return result;
32236 __pyx_fail:
32237  result.memview = NULL;
32238  result.data = NULL;
32239  return result;
32240 }
32241 
32242 /* ObjectToMemviewSlice */
32243  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
32244  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32245  __Pyx_BufFmt_StackElem stack[1];
32246  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32247  int retcode;
32248  if (obj == Py_None) {
32249  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32250  return result;
32251  }
32252  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32253  PyBUF_RECORDS_RO | writable_flag, 1,
32254  &__Pyx_TypeInfo_int, stack,
32255  &result, obj);
32256  if (unlikely(retcode == -1))
32257  goto __pyx_fail;
32258  return result;
32259 __pyx_fail:
32260  result.memview = NULL;
32261  result.data = NULL;
32262  return result;
32263 }
32264 
32265 /* ObjectToMemviewSlice */
32266  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
32267  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32268  __Pyx_BufFmt_StackElem stack[1];
32269  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32270  int retcode;
32271  if (obj == Py_None) {
32272  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32273  return result;
32274  }
32275  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32276  PyBUF_RECORDS_RO | writable_flag, 1,
32277  &__Pyx_TypeInfo_double, stack,
32278  &result, obj);
32279  if (unlikely(retcode == -1))
32280  goto __pyx_fail;
32281  return result;
32282 __pyx_fail:
32283  result.memview = NULL;
32284  result.data = NULL;
32285  return result;
32286 }
32287 
32288 /* ObjectToMemviewSlice */
32289  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj, int writable_flag) {
32290  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
32291  __Pyx_BufFmt_StackElem stack[1];
32292  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
32293  int retcode;
32294  if (obj == Py_None) {
32295  result.memview = (struct __pyx_memoryview_obj *) Py_None;
32296  return result;
32297  }
32298  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
32299  PyBUF_RECORDS_RO | writable_flag, 1,
32300  &__Pyx_TypeInfo_long__double, stack,
32301  &result, obj);
32302  if (unlikely(retcode == -1))
32303  goto __pyx_fail;
32304  return result;
32305 __pyx_fail:
32306  result.memview = NULL;
32307  result.data = NULL;
32308  return result;
32309 }
32310 
32311 /* MemviewSliceCopyTemplate */
32312  static __Pyx_memviewslice
32313 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
32314  const char *mode, int ndim,
32315  size_t sizeof_dtype, int contig_flag,
32316  int dtype_is_object)
32317 {
32318  __Pyx_RefNannyDeclarations
32319  int i;
32320  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
32321  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
32322  Py_buffer *buf = &from_memview->view;
32323  PyObject *shape_tuple = NULL;
32324  PyObject *temp_int = NULL;
32325  struct __pyx_array_obj *array_obj = NULL;
32326  struct __pyx_memoryview_obj *memview_obj = NULL;
32327  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
32328  for (i = 0; i < ndim; i++) {
32329  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
32330  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
32331  "indirect dimensions (axis %d)", i);
32332  goto fail;
32333  }
32334  }
32335  shape_tuple = PyTuple_New(ndim);
32336  if (unlikely(!shape_tuple)) {
32337  goto fail;
32338  }
32339  __Pyx_GOTREF(shape_tuple);
32340  for(i = 0; i < ndim; i++) {
32341  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
32342  if(unlikely(!temp_int)) {
32343  goto fail;
32344  } else {
32345  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
32346  temp_int = NULL;
32347  }
32348  }
32349  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
32350  if (unlikely(!array_obj)) {
32351  goto fail;
32352  }
32353  __Pyx_GOTREF(array_obj);
32354  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32355  (PyObject *) array_obj, contig_flag,
32356  dtype_is_object,
32357  from_mvs->memview->typeinfo);
32358  if (unlikely(!memview_obj))
32359  goto fail;
32360  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
32361  goto fail;
32362  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
32363  dtype_is_object) < 0))
32364  goto fail;
32365  goto no_fail;
32366 fail:
32367  __Pyx_XDECREF(new_mvs.memview);
32368  new_mvs.memview = NULL;
32369  new_mvs.data = NULL;
32370 no_fail:
32371  __Pyx_XDECREF(shape_tuple);
32372  __Pyx_XDECREF(temp_int);
32373  __Pyx_XDECREF(array_obj);
32374  __Pyx_RefNannyFinishContext();
32375  return new_mvs;
32376 }
32377 
32378 /* CIntToPy */
32379  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
32380 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32381 #pragma GCC diagnostic push
32382 #pragma GCC diagnostic ignored "-Wconversion"
32383 #endif
32384  const long neg_one = (long) -1, const_zero = (long) 0;
32385 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32386 #pragma GCC diagnostic pop
32387 #endif
32388  const int is_unsigned = neg_one > const_zero;
32389  if (is_unsigned) {
32390  if (sizeof(long) < sizeof(long)) {
32391  return PyInt_FromLong((long) value);
32392  } else if (sizeof(long) <= sizeof(unsigned long)) {
32393  return PyLong_FromUnsignedLong((unsigned long) value);
32394 #ifdef HAVE_LONG_LONG
32395  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
32396  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
32397 #endif
32398  }
32399  } else {
32400  if (sizeof(long) <= sizeof(long)) {
32401  return PyInt_FromLong((long) value);
32402 #ifdef HAVE_LONG_LONG
32403  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
32404  return PyLong_FromLongLong((PY_LONG_LONG) value);
32405 #endif
32406  }
32407  }
32408  {
32409  int one = 1; int little = (int)*(unsigned char *)&one;
32410  unsigned char *bytes = (unsigned char *)&value;
32411  return _PyLong_FromByteArray(bytes, sizeof(long),
32412  little, !is_unsigned);
32413  }
32414 }
32415 
32416 /* CIntFromPy */
32417  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
32418 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32419 #pragma GCC diagnostic push
32420 #pragma GCC diagnostic ignored "-Wconversion"
32421 #endif
32422  const int neg_one = (int) -1, const_zero = (int) 0;
32423 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32424 #pragma GCC diagnostic pop
32425 #endif
32426  const int is_unsigned = neg_one > const_zero;
32427 #if PY_MAJOR_VERSION < 3
32428  if (likely(PyInt_Check(x))) {
32429  if (sizeof(int) < sizeof(long)) {
32430  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
32431  } else {
32432  long val = PyInt_AS_LONG(x);
32433  if (is_unsigned && unlikely(val < 0)) {
32434  goto raise_neg_overflow;
32435  }
32436  return (int) val;
32437  }
32438  } else
32439 #endif
32440  if (likely(PyLong_Check(x))) {
32441  if (is_unsigned) {
32442 #if CYTHON_USE_PYLONG_INTERNALS
32443  const digit* digits = ((PyLongObject*)x)->ob_digit;
32444  switch (Py_SIZE(x)) {
32445  case 0: return (int) 0;
32446  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
32447  case 2:
32448  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
32449  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32450  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32451  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
32452  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32453  }
32454  }
32455  break;
32456  case 3:
32457  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
32458  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32459  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32460  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
32461  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32462  }
32463  }
32464  break;
32465  case 4:
32466  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
32467  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32468  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32469  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
32470  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
32471  }
32472  }
32473  break;
32474  }
32475 #endif
32476 #if CYTHON_COMPILING_IN_CPYTHON
32477  if (unlikely(Py_SIZE(x) < 0)) {
32478  goto raise_neg_overflow;
32479  }
32480 #else
32481  {
32482  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32483  if (unlikely(result < 0))
32484  return (int) -1;
32485  if (unlikely(result == 1))
32486  goto raise_neg_overflow;
32487  }
32488 #endif
32489  if (sizeof(int) <= sizeof(unsigned long)) {
32490  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
32491 #ifdef HAVE_LONG_LONG
32492  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
32493  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32494 #endif
32495  }
32496  } else {
32497 #if CYTHON_USE_PYLONG_INTERNALS
32498  const digit* digits = ((PyLongObject*)x)->ob_digit;
32499  switch (Py_SIZE(x)) {
32500  case 0: return (int) 0;
32501  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
32502  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
32503  case -2:
32504  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
32505  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32506  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32507  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
32508  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32509  }
32510  }
32511  break;
32512  case 2:
32513  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
32514  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32515  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32516  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
32517  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32518  }
32519  }
32520  break;
32521  case -3:
32522  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
32523  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32524  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32525  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
32526  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32527  }
32528  }
32529  break;
32530  case 3:
32531  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
32532  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32533  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32534  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
32535  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32536  }
32537  }
32538  break;
32539  case -4:
32540  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
32541  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32542  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32543  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
32544  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32545  }
32546  }
32547  break;
32548  case 4:
32549  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
32550  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32551  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32552  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
32553  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
32554  }
32555  }
32556  break;
32557  }
32558 #endif
32559  if (sizeof(int) <= sizeof(long)) {
32560  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
32561 #ifdef HAVE_LONG_LONG
32562  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
32563  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
32564 #endif
32565  }
32566  }
32567  {
32568 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32569  PyErr_SetString(PyExc_RuntimeError,
32570  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32571 #else
32572  int val;
32573  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32574  #if PY_MAJOR_VERSION < 3
32575  if (likely(v) && !PyLong_Check(v)) {
32576  PyObject *tmp = v;
32577  v = PyNumber_Long(tmp);
32578  Py_DECREF(tmp);
32579  }
32580  #endif
32581  if (likely(v)) {
32582  int one = 1; int is_little = (int)*(unsigned char *)&one;
32583  unsigned char *bytes = (unsigned char *)&val;
32584  int ret = _PyLong_AsByteArray((PyLongObject *)v,
32585  bytes, sizeof(val),
32586  is_little, !is_unsigned);
32587  Py_DECREF(v);
32588  if (likely(!ret))
32589  return val;
32590  }
32591 #endif
32592  return (int) -1;
32593  }
32594  } else {
32595  int val;
32596  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32597  if (!tmp) return (int) -1;
32598  val = __Pyx_PyInt_As_int(tmp);
32599  Py_DECREF(tmp);
32600  return val;
32601  }
32602 raise_overflow:
32603  PyErr_SetString(PyExc_OverflowError,
32604  "value too large to convert to int");
32605  return (int) -1;
32606 raise_neg_overflow:
32607  PyErr_SetString(PyExc_OverflowError,
32608  "can't convert negative value to int");
32609  return (int) -1;
32610 }
32611 
32612 /* CIntFromPy */
32613  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
32614 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32615 #pragma GCC diagnostic push
32616 #pragma GCC diagnostic ignored "-Wconversion"
32617 #endif
32618  const long neg_one = (long) -1, const_zero = (long) 0;
32619 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32620 #pragma GCC diagnostic pop
32621 #endif
32622  const int is_unsigned = neg_one > const_zero;
32623 #if PY_MAJOR_VERSION < 3
32624  if (likely(PyInt_Check(x))) {
32625  if (sizeof(long) < sizeof(long)) {
32626  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
32627  } else {
32628  long val = PyInt_AS_LONG(x);
32629  if (is_unsigned && unlikely(val < 0)) {
32630  goto raise_neg_overflow;
32631  }
32632  return (long) val;
32633  }
32634  } else
32635 #endif
32636  if (likely(PyLong_Check(x))) {
32637  if (is_unsigned) {
32638 #if CYTHON_USE_PYLONG_INTERNALS
32639  const digit* digits = ((PyLongObject*)x)->ob_digit;
32640  switch (Py_SIZE(x)) {
32641  case 0: return (long) 0;
32642  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
32643  case 2:
32644  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
32645  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32646  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32647  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
32648  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
32649  }
32650  }
32651  break;
32652  case 3:
32653  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
32654  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32655  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32656  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
32657  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
32658  }
32659  }
32660  break;
32661  case 4:
32662  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
32663  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32664  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32665  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
32666  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
32667  }
32668  }
32669  break;
32670  }
32671 #endif
32672 #if CYTHON_COMPILING_IN_CPYTHON
32673  if (unlikely(Py_SIZE(x) < 0)) {
32674  goto raise_neg_overflow;
32675  }
32676 #else
32677  {
32678  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32679  if (unlikely(result < 0))
32680  return (long) -1;
32681  if (unlikely(result == 1))
32682  goto raise_neg_overflow;
32683  }
32684 #endif
32685  if (sizeof(long) <= sizeof(unsigned long)) {
32686  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
32687 #ifdef HAVE_LONG_LONG
32688  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
32689  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32690 #endif
32691  }
32692  } else {
32693 #if CYTHON_USE_PYLONG_INTERNALS
32694  const digit* digits = ((PyLongObject*)x)->ob_digit;
32695  switch (Py_SIZE(x)) {
32696  case 0: return (long) 0;
32697  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
32698  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
32699  case -2:
32700  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
32701  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32702  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32703  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
32704  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32705  }
32706  }
32707  break;
32708  case 2:
32709  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
32710  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32711  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32712  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
32713  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32714  }
32715  }
32716  break;
32717  case -3:
32718  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
32719  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32720  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32721  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
32722  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32723  }
32724  }
32725  break;
32726  case 3:
32727  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
32728  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32729  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32730  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
32731  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32732  }
32733  }
32734  break;
32735  case -4:
32736  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
32737  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32738  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32739  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
32740  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32741  }
32742  }
32743  break;
32744  case 4:
32745  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
32746  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32747  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32748  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
32749  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32750  }
32751  }
32752  break;
32753  }
32754 #endif
32755  if (sizeof(long) <= sizeof(long)) {
32756  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
32757 #ifdef HAVE_LONG_LONG
32758  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
32759  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
32760 #endif
32761  }
32762  }
32763  {
32764 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32765  PyErr_SetString(PyExc_RuntimeError,
32766  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32767 #else
32768  long val;
32769  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32770  #if PY_MAJOR_VERSION < 3
32771  if (likely(v) && !PyLong_Check(v)) {
32772  PyObject *tmp = v;
32773  v = PyNumber_Long(tmp);
32774  Py_DECREF(tmp);
32775  }
32776  #endif
32777  if (likely(v)) {
32778  int one = 1; int is_little = (int)*(unsigned char *)&one;
32779  unsigned char *bytes = (unsigned char *)&val;
32780  int ret = _PyLong_AsByteArray((PyLongObject *)v,
32781  bytes, sizeof(val),
32782  is_little, !is_unsigned);
32783  Py_DECREF(v);
32784  if (likely(!ret))
32785  return val;
32786  }
32787 #endif
32788  return (long) -1;
32789  }
32790  } else {
32791  long val;
32792  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32793  if (!tmp) return (long) -1;
32794  val = __Pyx_PyInt_As_long(tmp);
32795  Py_DECREF(tmp);
32796  return val;
32797  }
32798 raise_overflow:
32799  PyErr_SetString(PyExc_OverflowError,
32800  "value too large to convert to long");
32801  return (long) -1;
32802 raise_neg_overflow:
32803  PyErr_SetString(PyExc_OverflowError,
32804  "can't convert negative value to long");
32805  return (long) -1;
32806 }
32807 
32808 /* CIntToPy */
32809  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
32810 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32811 #pragma GCC diagnostic push
32812 #pragma GCC diagnostic ignored "-Wconversion"
32813 #endif
32814  const int neg_one = (int) -1, const_zero = (int) 0;
32815 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32816 #pragma GCC diagnostic pop
32817 #endif
32818  const int is_unsigned = neg_one > const_zero;
32819  if (is_unsigned) {
32820  if (sizeof(int) < sizeof(long)) {
32821  return PyInt_FromLong((long) value);
32822  } else if (sizeof(int) <= sizeof(unsigned long)) {
32823  return PyLong_FromUnsignedLong((unsigned long) value);
32824 #ifdef HAVE_LONG_LONG
32825  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
32826  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
32827 #endif
32828  }
32829  } else {
32830  if (sizeof(int) <= sizeof(long)) {
32831  return PyInt_FromLong((long) value);
32832 #ifdef HAVE_LONG_LONG
32833  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
32834  return PyLong_FromLongLong((PY_LONG_LONG) value);
32835 #endif
32836  }
32837  }
32838  {
32839  int one = 1; int little = (int)*(unsigned char *)&one;
32840  unsigned char *bytes = (unsigned char *)&value;
32841  return _PyLong_FromByteArray(bytes, sizeof(int),
32842  little, !is_unsigned);
32843  }
32844 }
32845 
32846 /* CIntFromPy */
32847  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
32848 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32849 #pragma GCC diagnostic push
32850 #pragma GCC diagnostic ignored "-Wconversion"
32851 #endif
32852  const char neg_one = (char) -1, const_zero = (char) 0;
32853 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32854 #pragma GCC diagnostic pop
32855 #endif
32856  const int is_unsigned = neg_one > const_zero;
32857 #if PY_MAJOR_VERSION < 3
32858  if (likely(PyInt_Check(x))) {
32859  if (sizeof(char) < sizeof(long)) {
32860  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
32861  } else {
32862  long val = PyInt_AS_LONG(x);
32863  if (is_unsigned && unlikely(val < 0)) {
32864  goto raise_neg_overflow;
32865  }
32866  return (char) val;
32867  }
32868  } else
32869 #endif
32870  if (likely(PyLong_Check(x))) {
32871  if (is_unsigned) {
32872 #if CYTHON_USE_PYLONG_INTERNALS
32873  const digit* digits = ((PyLongObject*)x)->ob_digit;
32874  switch (Py_SIZE(x)) {
32875  case 0: return (char) 0;
32876  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
32877  case 2:
32878  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
32879  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32880  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32881  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
32882  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
32883  }
32884  }
32885  break;
32886  case 3:
32887  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
32888  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32889  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32890  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
32891  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
32892  }
32893  }
32894  break;
32895  case 4:
32896  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
32897  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32898  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32899  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
32900  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
32901  }
32902  }
32903  break;
32904  }
32905 #endif
32906 #if CYTHON_COMPILING_IN_CPYTHON
32907  if (unlikely(Py_SIZE(x) < 0)) {
32908  goto raise_neg_overflow;
32909  }
32910 #else
32911  {
32912  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32913  if (unlikely(result < 0))
32914  return (char) -1;
32915  if (unlikely(result == 1))
32916  goto raise_neg_overflow;
32917  }
32918 #endif
32919  if (sizeof(char) <= sizeof(unsigned long)) {
32920  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
32921 #ifdef HAVE_LONG_LONG
32922  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
32923  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32924 #endif
32925  }
32926  } else {
32927 #if CYTHON_USE_PYLONG_INTERNALS
32928  const digit* digits = ((PyLongObject*)x)->ob_digit;
32929  switch (Py_SIZE(x)) {
32930  case 0: return (char) 0;
32931  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
32932  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
32933  case -2:
32934  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
32935  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32936  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32937  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
32938  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32939  }
32940  }
32941  break;
32942  case 2:
32943  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
32944  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32945  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32946  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
32947  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32948  }
32949  }
32950  break;
32951  case -3:
32952  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
32953  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32954  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32955  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
32956  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32957  }
32958  }
32959  break;
32960  case 3:
32961  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
32962  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32963  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32964  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
32965  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32966  }
32967  }
32968  break;
32969  case -4:
32970  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
32971  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32972  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32973  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
32974  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32975  }
32976  }
32977  break;
32978  case 4:
32979  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
32980  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32981  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32982  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
32983  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32984  }
32985  }
32986  break;
32987  }
32988 #endif
32989  if (sizeof(char) <= sizeof(long)) {
32990  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
32991 #ifdef HAVE_LONG_LONG
32992  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
32993  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
32994 #endif
32995  }
32996  }
32997  {
32998 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32999  PyErr_SetString(PyExc_RuntimeError,
33000  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
33001 #else
33002  char val;
33003  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
33004  #if PY_MAJOR_VERSION < 3
33005  if (likely(v) && !PyLong_Check(v)) {
33006  PyObject *tmp = v;
33007  v = PyNumber_Long(tmp);
33008  Py_DECREF(tmp);
33009  }
33010  #endif
33011  if (likely(v)) {
33012  int one = 1; int is_little = (int)*(unsigned char *)&one;
33013  unsigned char *bytes = (unsigned char *)&val;
33014  int ret = _PyLong_AsByteArray((PyLongObject *)v,
33015  bytes, sizeof(val),
33016  is_little, !is_unsigned);
33017  Py_DECREF(v);
33018  if (likely(!ret))
33019  return val;
33020  }
33021 #endif
33022  return (char) -1;
33023  }
33024  } else {
33025  char val;
33026  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33027  if (!tmp) return (char) -1;
33028  val = __Pyx_PyInt_As_char(tmp);
33029  Py_DECREF(tmp);
33030  return val;
33031  }
33032 raise_overflow:
33033  PyErr_SetString(PyExc_OverflowError,
33034  "value too large to convert to char");
33035  return (char) -1;
33036 raise_neg_overflow:
33037  PyErr_SetString(PyExc_OverflowError,
33038  "can't convert negative value to char");
33039  return (char) -1;
33040 }
33041 
33042 /* CheckBinaryVersion */
33043  static int __Pyx_check_binary_version(void) {
33044  char ctversion[4], rtversion[4];
33045  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
33046  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
33047  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
33048  char message[200];
33049  PyOS_snprintf(message, sizeof(message),
33050  "compiletime version %s of module '%.100s' "
33051  "does not match runtime version %s",
33052  ctversion, __Pyx_MODULE_NAME, rtversion);
33053  return PyErr_WarnEx(NULL, message, 1);
33054  }
33055  return 0;
33056 }
33057 
33058 /* InitStrings */
33059  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
33060  while (t->p) {
33061  #if PY_MAJOR_VERSION < 3
33062  if (t->is_unicode) {
33063  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
33064  } else if (t->intern) {
33065  *t->p = PyString_InternFromString(t->s);
33066  } else {
33067  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
33068  }
33069  #else
33070  if (t->is_unicode | t->is_str) {
33071  if (t->intern) {
33072  *t->p = PyUnicode_InternFromString(t->s);
33073  } else if (t->encoding) {
33074  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
33075  } else {
33076  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
33077  }
33078  } else {
33079  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
33080  }
33081  #endif
33082  if (!*t->p)
33083  return -1;
33084  if (PyObject_Hash(*t->p) == -1)
33085  return -1;
33086  ++t;
33087  }
33088  return 0;
33089 }
33090 
33091 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
33092  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
33093 }
33094 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
33095  Py_ssize_t ignore;
33096  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
33097 }
33098 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33099 #if !CYTHON_PEP393_ENABLED
33100 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33101  char* defenc_c;
33102  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
33103  if (!defenc) return NULL;
33104  defenc_c = PyBytes_AS_STRING(defenc);
33105 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33106  {
33107  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
33108  char* c;
33109  for (c = defenc_c; c < end; c++) {
33110  if ((unsigned char) (*c) >= 128) {
33111  PyUnicode_AsASCIIString(o);
33112  return NULL;
33113  }
33114  }
33115  }
33116 #endif
33117  *length = PyBytes_GET_SIZE(defenc);
33118  return defenc_c;
33119 }
33120 #else
33121 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33122  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
33123 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33124  if (likely(PyUnicode_IS_ASCII(o))) {
33125  *length = PyUnicode_GET_LENGTH(o);
33126  return PyUnicode_AsUTF8(o);
33127  } else {
33128  PyUnicode_AsASCIIString(o);
33129  return NULL;
33130  }
33131 #else
33132  return PyUnicode_AsUTF8AndSize(o, length);
33133 #endif
33134 }
33135 #endif
33136 #endif
33137 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
33138 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33139  if (
33140 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33141  __Pyx_sys_getdefaultencoding_not_ascii &&
33142 #endif
33143  PyUnicode_Check(o)) {
33144  return __Pyx_PyUnicode_AsStringAndSize(o, length);
33145  } else
33146 #endif
33147 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
33148  if (PyByteArray_Check(o)) {
33149  *length = PyByteArray_GET_SIZE(o);
33150  return PyByteArray_AS_STRING(o);
33151  } else
33152 #endif
33153  {
33154  char* result;
33155  int r = PyBytes_AsStringAndSize(o, &result, length);
33156  if (unlikely(r < 0)) {
33157  return NULL;
33158  } else {
33159  return result;
33160  }
33161  }
33162 }
33163 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
33164  int is_true = x == Py_True;
33165  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
33166  else return PyObject_IsTrue(x);
33167 }
33168 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
33169  int retval;
33170  if (unlikely(!x)) return -1;
33171  retval = __Pyx_PyObject_IsTrue(x);
33172  Py_DECREF(x);
33173  return retval;
33174 }
33175 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
33176 #if PY_MAJOR_VERSION >= 3
33177  if (PyLong_Check(result)) {
33178  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
33179  "__int__ returned non-int (type %.200s). "
33180  "The ability to return an instance of a strict subclass of int "
33181  "is deprecated, and may be removed in a future version of Python.",
33182  Py_TYPE(result)->tp_name)) {
33183  Py_DECREF(result);
33184  return NULL;
33185  }
33186  return result;
33187  }
33188 #endif
33189  PyErr_Format(PyExc_TypeError,
33190  "__%.4s__ returned non-%.4s (type %.200s)",
33191  type_name, type_name, Py_TYPE(result)->tp_name);
33192  Py_DECREF(result);
33193  return NULL;
33194 }
33195 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
33196 #if CYTHON_USE_TYPE_SLOTS
33197  PyNumberMethods *m;
33198 #endif
33199  const char *name = NULL;
33200  PyObject *res = NULL;
33201 #if PY_MAJOR_VERSION < 3
33202  if (likely(PyInt_Check(x) || PyLong_Check(x)))
33203 #else
33204  if (likely(PyLong_Check(x)))
33205 #endif
33206  return __Pyx_NewRef(x);
33207 #if CYTHON_USE_TYPE_SLOTS
33208  m = Py_TYPE(x)->tp_as_number;
33209  #if PY_MAJOR_VERSION < 3
33210  if (m && m->nb_int) {
33211  name = "int";
33212  res = m->nb_int(x);
33213  }
33214  else if (m && m->nb_long) {
33215  name = "long";
33216  res = m->nb_long(x);
33217  }
33218  #else
33219  if (likely(m && m->nb_int)) {
33220  name = "int";
33221  res = m->nb_int(x);
33222  }
33223  #endif
33224 #else
33225  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
33226  res = PyNumber_Int(x);
33227  }
33228 #endif
33229  if (likely(res)) {
33230 #if PY_MAJOR_VERSION < 3
33231  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
33232 #else
33233  if (unlikely(!PyLong_CheckExact(res))) {
33234 #endif
33235  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
33236  }
33237  }
33238  else if (!PyErr_Occurred()) {
33239  PyErr_SetString(PyExc_TypeError,
33240  "an integer is required");
33241  }
33242  return res;
33243 }
33244 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
33245  Py_ssize_t ival;
33246  PyObject *x;
33247 #if PY_MAJOR_VERSION < 3
33248  if (likely(PyInt_CheckExact(b))) {
33249  if (sizeof(Py_ssize_t) >= sizeof(long))
33250  return PyInt_AS_LONG(b);
33251  else
33252  return PyInt_AsSsize_t(b);
33253  }
33254 #endif
33255  if (likely(PyLong_CheckExact(b))) {
33256  #if CYTHON_USE_PYLONG_INTERNALS
33257  const digit* digits = ((PyLongObject*)b)->ob_digit;
33258  const Py_ssize_t size = Py_SIZE(b);
33259  if (likely(__Pyx_sst_abs(size) <= 1)) {
33260  ival = likely(size) ? digits[0] : 0;
33261  if (size == -1) ival = -ival;
33262  return ival;
33263  } else {
33264  switch (size) {
33265  case 2:
33266  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33267  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33268  }
33269  break;
33270  case -2:
33271  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
33272  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33273  }
33274  break;
33275  case 3:
33276  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33277  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33278  }
33279  break;
33280  case -3:
33281  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
33282  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33283  }
33284  break;
33285  case 4:
33286  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33287  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33288  }
33289  break;
33290  case -4:
33291  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
33292  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
33293  }
33294  break;
33295  }
33296  }
33297  #endif
33298  return PyLong_AsSsize_t(b);
33299  }
33300  x = PyNumber_Index(b);
33301  if (!x) return -1;
33302  ival = PyInt_AsSsize_t(x);
33303  Py_DECREF(x);
33304  return ival;
33305 }
33306 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
33307  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
33308 }
33309 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
33310  return PyInt_FromSize_t(ival);
33311 }
33312 
33313 
33314 #endif /* Py_PYTHON_H */
Base class for linear operators. This class serves as interface for all derived classes.